# coding: utf-8
from sqlalchemy import CHAR, Column, DECIMAL, Date, DateTime, Enum, Float, Index, LargeBinary, String, TIMESTAMP, Table, Text, text
from sqlalchemy.dialects.mysql import BIGINT, DATETIME, DECIMAL, INTEGER, LONGTEXT, MEDIUMINT, MEDIUMTEXT, SMALLINT, TINYINT, VARCHAR
from sqlalchemy.ext.declarative import declarative_base

Base = declarative_base()
metadata = Base.metadata


class AccountTokenRelationship(Base):
    __tablename__ = 'account_token_relationship'

    id = Column(INTEGER(11), primary_key=True)
    account_token_relationship_id = Column(String(32, 'utf8_unicode_ci'), nullable=False, server_default=text("'0'"), comment='管理ID')
    employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='员工ID')
    token = Column(String(64, 'utf8_unicode_ci'), nullable=False, server_default=text("'0'"), comment='登录token')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    ip = Column(String(32, 'utf8_unicode_ci'), nullable=False, server_default=text("'0'"), comment='登录ip')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    organizationid = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='组织ID')
    employee_auth = Column('employee-auth', LONGTEXT, comment='员工权限')


class ActivityOperationConf(Base):
    __tablename__ = 'activity_operation_conf'

    activity_operation_conf_id = Column(INTEGER(11), primary_key=True)
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店id')
    wechat = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='运营活动-微信 1开通  0关闭')
    app = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='运营活动-APP 1开通  0关闭')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class ActivityOrder(Base):
    __tablename__ = 'activity_order'

    id = Column(INTEGER(11), primary_key=True, comment='主键id')
    activity_order_id = Column(String(32), nullable=False, server_default=text("''"), comment='uuid')
    client_name = Column(String(10), nullable=False, server_default=text("''"), comment='来源客户端')
    tenant_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='租户id')
    price = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='订单金额')
    num = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='抽奖码数量')
    pay_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='支付状态:0未支付1已支付')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否删除; 1:正常, 2:删除')
    name = Column(String(100), nullable=False, server_default=text("''"), comment='租户姓名')


class ActivityOrderCode(Base):
    __tablename__ = 'activity_order_code'

    id = Column(INTEGER(11), primary_key=True, comment='主键id')
    activity_order_code_id = Column(String(32), nullable=False, server_default=text("''"), comment='uuid')
    activity_order_id = Column(String(32), nullable=False, server_default=text("''"), comment='活动订单id')
    tenant_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='租户id')
    code = Column(String(10), nullable=False, server_default=text("''"), comment='抽奖码')
    win = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='中奖:0未中奖1中奖')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否删除; 1:正常, 2:删除')
    price = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='中奖金额')
    level = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='中奖等级')
    name = Column(String(100), nullable=False, server_default=text("''"), comment='租户姓名')


class ActivityRedpacket(Base):
    __tablename__ = 'activity_redpackets'

    activity_redpackets_id = Column(INTEGER(11), primary_key=True)
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店id')
    tenant_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='租客id')
    phone = Column(String(13), nullable=False, server_default=text("''"), comment='电话号码')
    bill_id = Column(String(100), nullable=False, server_default=text("'0'"), comment='实收记录表id')
    activity_redpackets_conf_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='红包配置id')
    money = Column(Float(10, True), nullable=False, server_default=text("'0.00'"), comment='中奖金额')
    code = Column(String(20), nullable=False, server_default=text("''"), comment='兑奖码')
    is_used = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否使用')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class ActivityRedpacketsConf(Base):
    __tablename__ = 'activity_redpackets_conf'

    activity_redpackets_conf_id = Column(INTEGER(11), primary_key=True)
    title = Column(String(20), nullable=False, server_default=text("''"), comment='标题')
    money = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='红包金额')
    max_number = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='总数量')
    number = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='数量')
    probability = Column(INTEGER(3), nullable=False, server_default=text("'0'"), comment='概率')
    start_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='开始时间')
    end_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='结束时间')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class ActivitySendMessage(Base):
    __tablename__ = 'activity_send_message'

    activity_send_message_id = Column(INTEGER(11), primary_key=True, comment='id')
    phone = Column(String(11), nullable=False, server_default=text("'0'"), comment='手机号码')
    activity = Column(String(10), nullable=False, server_default=text("'cutprice'"), comment='活动类型')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class AgreementPremiseApartment(Base):
    __tablename__ = 'agreement_premise_apartment'

    ap_apartment_id = Column(String(32), primary_key=True, comment='ID主键')
    ap_apartment_sn = Column(INTEGER(11), nullable=False, index=True, comment='门店物业设施编号')
    ap_collect_id = Column(String(32), nullable=False, server_default=text("''"), comment='物业设施名称(外键id)')
    apartment_id = Column(String(32), nullable=False, server_default=text("''"), comment='门店ID')
    Ap_apartment_number = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='数量')
    Ap_apartment_price = Column(DECIMAL(12, 2), nullable=False, server_default=text("'0.00'"), comment='单价')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    delete_status = Column(INTEGER(11), nullable=False, server_default=text("'1'"), comment='删除状态：1正常，2删除')


class AgreementPremiseCollect(Base):
    __tablename__ = 'agreement_premise_collect'

    ap_collect_id = Column(String(32), primary_key=True, comment='ID主键')
    ap_collect_sn = Column(INTEGER(11), nullable=False, index=True, comment='物业设施编号')
    Ap_type_id = Column(String(32), nullable=False, server_default=text("''"), comment='物业设施类型id')
    Ap_name = Column(String(32), nullable=False, server_default=text("''"), comment='物业设施名称')
    Ap_code = Column(String(32), nullable=False, server_default=text("''"), comment='物业设施code')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    delete_status = Column(INTEGER(11), nullable=False, server_default=text("'1'"), comment='删除状态：1正常，2删除')


class AgreementPremiseDelivery(Base):
    __tablename__ = 'agreement_premise_delivery'

    Ap_delivery_id = Column(String(32), primary_key=True, comment='ID主键')
    Ap_room_id = Column(String(32), nullable=False, server_default=text("''"), comment='房间id')
    Ap_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='交割单状态:0未确认,1确认,2历史')
    Ap_Confirm_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='确认时间')
    Ap_is_new = Column(TINYINT(1), server_default=text("'1'"), comment='是否最新')
    Ap_Remark = Column(String(500), server_default=text("''"), comment='备注')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    delete_status = Column(INTEGER(11), nullable=False, server_default=text("'1'"), comment='删除状态：1正常，2删除')


class AgreementPremiseDetail(Base):
    __tablename__ = 'agreement_premise_details'

    Ap_details_id = Column(String(32), primary_key=True, comment='ID主键')
    ap_delivery_id = Column(String(32), nullable=False, server_default=text("''"), comment='物业交割单id (外键)')
    ap_apartment_id = Column(String(32), nullable=False, comment='门店物业清单id(外键)')
    Ap_delivery_number = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='数量')
    Ap_delivery_price = Column(DECIMAL(12, 2), nullable=False, server_default=text("'0.00'"), comment='单价')
    Ap_status = Column(TINYINT(1), server_default=text("'1'"), comment='状态 1良好,2待修')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    delete_status = Column(INTEGER(11), nullable=False, server_default=text("'1'"), comment='删除状态：1正常，2删除')


class AgreementPremiseOther(Base):
    __tablename__ = 'agreement_premise_other'

    Ap_other_id = Column(String(32), primary_key=True, comment='ID主键')
    ap_delivery_id = Column(String(32), server_default=text("''"), comment='物业交割单id(外键)')
    Ap_equipment = Column(String(32), nullable=False, server_default=text("'electric'"), comment='设备枚举值(water水表, electric电表)')
    Ap_other_type = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='设备类型1设备号,2设备数值')
    Ap_information = Column(String(100), server_default=text("''"), comment='信息内容')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    delete_status = Column(INTEGER(11), nullable=False, server_default=text("'1'"), comment='删除状态：1正常，2删除')


class AgreementPremiseType(Base):
    __tablename__ = 'agreement_premise_type'

    ap_type_id = Column(String(32), primary_key=True, comment='ID主键')
    Ap_type = Column(String(32), nullable=False, server_default=text("''"), comment='物业设施类型')
    ap_sort = Column(INTEGER(11), server_default=text("'1'"), comment='排序值')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    delete_status = Column(INTEGER(11), nullable=False, server_default=text("'1'"), comment='删除状态：1正常，2删除')


class AhastyleMember(Base):
    __tablename__ = 'ahastyle_member'

    member_id = Column(INTEGER(11), primary_key=True, comment='ID')
    member_name = Column(String(500), nullable=False, server_default=text("''"), comment='啊哈用户姓名')
    phone = Column(String(500), nullable=False, server_default=text("''"), comment='手机号')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    status = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='支付状态')
    isReceive = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='是否领取')
    order_num = Column(String(200), nullable=False, server_default=text("''"), comment='对外提供的唯一订单号')
    pay_way = Column(String(200), nullable=False, server_default=text("''"), comment='方式')
    pay_channel = Column(String(200), nullable=False, server_default=text("''"), comment='渠道')
    pay_money = Column(DECIMAL(10, 0), nullable=False, server_default=text("'0'"), comment='支付金额')
    pay_standard = Column(DECIMAL(10, 4), nullable=False, server_default=text("'0.0000'"), comment='收费标准')
    pay_standard_money = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='第三方手续费')
    received_money = Column(DECIMAL(10, 0), nullable=False, server_default=text("'0'"), comment='实际已收金额')
    from_way = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='1app,2wx,3pc')
    is_customer = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否本人支付 1是 0 不是')
    merchant_id = Column(String(200), nullable=False, server_default=text("''"), comment='商户号')
    pay_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='支付时间')
    goods_num = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='购买数量')
    goods_price = Column(INTEGER(11), server_default=text("'0'"), comment='单价')


class AllinpayMemberCompany(Base):
    __tablename__ = 'allinpay_member_company'

    allinpay_member_company_id = Column(INTEGER(11), primary_key=True)
    allinpay_user_id = Column(String(100), nullable=False, server_default=text("''"), comment='云商通用户ID')
    source = Column(TINYINT(1), nullable=False, server_default=text("'2'"), comment='访问终端类型 1:mobile 2:pc')
    company_name = Column(String(200), nullable=False, server_default=text("''"), comment='企业名称')
    company_address = Column(String(255), nullable=False, server_default=text("''"), comment='企业地址')
    auth_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='1:三证 2:一证')
    uni_credit = Column(String(30), nullable=False, server_default=text("''"), comment='统一社会信用(一证)')
    business_license = Column(String(50), nullable=False, server_default=text("''"), comment='营业执照号(三证)')
    organization_code = Column(String(50), nullable=False, server_default=text("''"), comment='组织机构代码(三证)')
    tax_register = Column(String(50), nullable=False, server_default=text("''"), comment='税务登记证(三证)')
    exp_license = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='证件到期时间')
    phone_md5 = Column(String(32), nullable=False, index=True, server_default=text("''"), comment='联系电话MD5')
    phone = Column(LargeBinary, nullable=False, comment='联系电话')
    legal_name = Column(String(30), nullable=False, server_default=text("''"), comment='法人姓名')
    identity_type = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='法人证件类型 身份证:1 护照:2 军官证:3 回乡证:4 台胞证:5 警官证:6 士兵证:7 其它证件:99')
    legal_ids_md5 = Column(String(32), nullable=False, index=True, server_default=text("''"), comment='法人证件号MD5')
    legal_ids = Column(LargeBinary, nullable=False, comment='法人证件号')
    legal_phone_md5 = Column(String(32), nullable=False, index=True, server_default=text("''"), comment='法人手机号码MD5')
    legal_phone = Column(LargeBinary, nullable=False, comment='法人手机号码')
    company_province = Column(TINYINT(3), nullable=False, server_default=text("'0'"), comment='企业所在省')
    company_city = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='企业所在市')
    is_sign = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否签约（通联）')
    contract_no = Column(String(50), nullable=False, server_default=text("''"), comment='会员电子协议编号')
    audit_status = Column(TINYINT(2), nullable=False, server_default=text("'0'"), comment='审核状态：0: 未审核 1:审核中 2:成功 3:失败')
    audit_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='审核时间')
    remark = Column(String(255), nullable=False, server_default=text("''"), comment='备注')
    fail_reason = Column(String(255), nullable=False, server_default=text("''"), comment='失败原因')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class AllinpayMemberPersonal(Base):
    __tablename__ = 'allinpay_member_personal'

    allinpay_member_personal_id = Column(INTEGER(11), primary_key=True)
    real_name = Column(String(32), nullable=False, server_default=text("''"), comment='真实姓名')
    allinpay_user_id = Column(String(100), nullable=False, server_default=text("''"), comment='云商通用户ID')
    phone_md5 = Column(String(32), nullable=False, index=True, server_default=text("''"), comment='客户手机号MD5')
    phone = Column(LargeBinary, nullable=False, comment='客户手机号码密文')
    source = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='访问终端类型 1:mobile 2:pc')
    is_sign = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否签约（通联）')
    contract_no = Column(String(50), nullable=False, index=True, server_default=text("''"), comment='会员电子协议编号')
    auth_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='实名认证状态：1:未认证 2:认证成功 3:认证失败')
    identity_type = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='证件类型')
    identity_no = Column(LargeBinary, nullable=False, comment='证件号')
    identity_no_md5 = Column(String(32), nullable=False, index=True, server_default=text("''"), comment='证件号码MD5')
    extend_param = Column(String(200), nullable=False, server_default=text("''"), comment='扩展参数')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class AllinpayMerchantPayer(Base):
    __tablename__ = 'allinpay_merchant_payer'

    payer_id = Column(INTEGER(11), primary_key=True)
    merchant_id = Column(String(32), nullable=False, index=True, server_default=text("''"), comment='商户号')
    times = Column(TINYINT(3), nullable=False, server_default=text("'0'"), comment='下单次数')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class Apartment(Base):
    __tablename__ = 'apartment'

    apartment_id = Column(INTEGER(11), primary_key=True, index=True)
    unique_id = Column(String(32), nullable=False, server_default=text("''"), comment='唯一不重复id')
    apartment_code = Column(String(10), nullable=False, server_default=text("'0'"), comment='门店编码')
    apartment_type = Column(TINYINT(2), nullable=False, server_default=text("'1'"), comment='门店类型1:筹开,2:运营,3:单店')
    brand_type = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='品牌类型(1乐乎2有朋)')
    cooperation_type = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='合作方式(1托管2包租3加盟)')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    is_dispersion = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否分散式')
    apartment_name = Column(String(20), nullable=False, server_default=text("''"), comment='公寓名')
    apartment_number = Column(String(20), nullable=False, server_default=text("''"), comment='公寓编号')
    bottom_price = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='门店保底价')
    province_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='省份ID')
    city_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='城市ID')
    area_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='区域ID')
    zone_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='商圈ID')
    employee_group_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='员工分组表ID')
    address = Column(String(255), nullable=False, server_default=text("''"), comment='公寓地址')
    commercial_tenant_account = Column(String(128), nullable=False, server_default=text("' '"), comment='商户号')
    commercial_tenant_name = Column(String(64), nullable=False, server_default=text("' '"), comment='商户名称')
    longitude = Column(DECIMAL(14, 6), nullable=False, server_default=text("'0.000000'"), comment='经度')
    latitude = Column(DECIMAL(14, 6), nullable=False, server_default=text("'0.000000'"), comment='纬度')
    gmap_longitude = Column(DECIMAL(16, 12), nullable=False, server_default=text("'0.000000000000'"), comment='高德经度')
    gmap_latitude = Column(DECIMAL(16, 12), nullable=False, server_default=text("'0.000000000000'"), comment='高德纬度')
    Intelligent_lock = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否有智能门锁')
    is_open = Column(TINYINT(1), nullable=False, server_default=text("'1'"))
    opening_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否开业(1是,0否)')
    opening_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='开业时间')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    sms_signature = Column(String(64), nullable=False, server_default=text("''"), comment='短信签名')
    apartment_group_id = Column(String(32), nullable=False, server_default=text("' '"), comment='门店组主键')
    is_service_charge = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='手续费承担')
    is_by_stages = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否分账')
    is_supervise = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否接入监管0否1是')
    supervise_status = Column(TINYINT(2), nullable=False, server_default=text("'0'"), comment='监管备案状态0未提审1待审核2审核成功3审核失败4其它状态')
    supervise_error_log = Column(String(100), comment='审核失败原因')


class ApartmentCleanConf(Base):
    __tablename__ = 'apartment_clean_conf'

    id = Column(INTEGER(11), primary_key=True)
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店id')
    min_amount = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='最小数量')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class ApartmentContractConfig(Base):
    __tablename__ = 'apartment_contract_config'

    contract_config_id = Column(String(32), primary_key=True, server_default=text("''"), comment='合同押付方案主键')
    deposit_month = Column(TINYINT(2), nullable=False, server_default=text("'0'"), comment='押金支付月份')
    rent_month = Column(TINYINT(2), nullable=False, server_default=text("'0'"), comment='租金支付月份')
    discount_scale = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='租金系数')
    allow_less_three_month = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='大于三个月可选1允许0不允许')
    is_default = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否默认')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class ApartmentContractConfigApartmentRelationship(Base):
    __tablename__ = 'apartment_contract_config_apartment_relationship'

    contract_config_apartment_relationship_id = Column(String(32), primary_key=True, server_default=text("''"), comment='合同押付方案门店关系主键')
    contract_scheme_id = Column(String(32), nullable=False, index=True, server_default=text("''"), comment='合同方案主键')
    contract_config_id = Column(String(32), nullable=False, index=True, comment='合同押付方式主键')
    apartment_id = Column(String(32), nullable=False, index=True, server_default=text("'0'"), comment='门店主键')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class ApartmentContractPeriod(Base):
    __tablename__ = 'apartment_contract_period'

    contract_period_id = Column(String(32), primary_key=True, server_default=text("''"), comment='合同周期主键')
    period = Column(TINYINT(4), nullable=False, server_default=text("'0'"), comment='周期数')
    discount_scale = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='租金系数')
    is_default = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否默认')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class ApartmentContractPeriodApartmentRelationship(Base):
    __tablename__ = 'apartment_contract_period_apartment_relationship'

    contract_period_apartment_relationship_id = Column(String(32), primary_key=True, server_default=text("''"), comment='合同周期门店关系表')
    contract_scheme_id = Column(String(32), nullable=False, index=True, server_default=text("''"), comment='合同方案主键')
    contract_period_id = Column(String(32), nullable=False, index=True, server_default=text("''"), comment='合同周期主键')
    apartment_id = Column(String(32), nullable=False, index=True, server_default=text("'0'"), comment='门店主键')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class ApartmentContractScheme(Base):
    __tablename__ = 'apartment_contract_scheme'

    scheme_id = Column(String(32), primary_key=True, server_default=text("''"), comment='方案主键')
    scheme_name = Column(String(255), nullable=False, server_default=text("''"), comment='方案名称')
    is_system = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否系统默认')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人id')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    only_rent_rise = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='租金上浮定金押金不上浮 1是0否')
    contract_bill_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='合同账单类型 0:对日按月  1: 自然月')
    first_bill_day = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='首期账单日期合并节点日')


class ApartmentCopy(Base):
    __tablename__ = 'apartment_copy'

    apartment_id = Column(INTEGER(11), primary_key=True, index=True)
    unique_id = Column(String(32), nullable=False, server_default=text("''"), comment='唯一不重复id')
    apartment_code = Column(String(10), nullable=False, server_default=text("'0'"), comment='门店编码')
    apartment_type = Column(TINYINT(2), nullable=False, server_default=text("'1'"), comment='门店类型1:筹开,2:运营,3:单店')
    brand_type = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='品牌类型(1乐乎2有朋)')
    cooperation_type = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='合作方式(1托管2包租3加盟)')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    is_dispersion = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否分散式')
    apartment_name = Column(String(20), nullable=False, server_default=text("''"), comment='公寓名')
    apartment_number = Column(String(20), nullable=False, server_default=text("''"), comment='公寓编号')
    bottom_price = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='门店保底价')
    province_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='省份ID')
    city_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='城市ID')
    area_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='区域ID')
    zone_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='商圈ID')
    employee_group_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='员工分组表ID')
    address = Column(String(255), nullable=False, server_default=text("''"), comment='公寓地址')
    commercial_tenant_account = Column(String(128), nullable=False, server_default=text("' '"), comment='商户号')
    commercial_tenant_name = Column(String(64), nullable=False, server_default=text("' '"), comment='商户名称')
    longitude = Column(DECIMAL(14, 6), nullable=False, server_default=text("'0.000000'"), comment='经度')
    latitude = Column(DECIMAL(14, 6), nullable=False, server_default=text("'0.000000'"), comment='纬度')
    gmap_longitude = Column(DECIMAL(16, 12), nullable=False, server_default=text("'0.000000000000'"), comment='高德经度')
    gmap_latitude = Column(DECIMAL(16, 12), nullable=False, server_default=text("'0.000000000000'"), comment='高德纬度')
    Intelligent_lock = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否有智能门锁')
    is_open = Column(TINYINT(1), nullable=False, server_default=text("'1'"))
    opening_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否开业(1是,0否)')
    opening_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='开业时间')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    sms_signature = Column(String(64), nullable=False, server_default=text("''"), comment='短信签名')
    apartment_group_id = Column(String(32), nullable=False, server_default=text("' '"), comment='门店组主键')


class ApartmentCopy2(Base):
    __tablename__ = 'apartment_copy2'

    apartment_id = Column(INTEGER(11), primary_key=True, index=True)
    unique_id = Column(String(32), nullable=False, server_default=text("''"), comment='唯一不重复id')
    apartment_code = Column(String(10), nullable=False, server_default=text("'0'"), comment='门店编码')
    apartment_type = Column(TINYINT(2), nullable=False, server_default=text("'1'"), comment='门店类型1:筹开,2:运营,3:单店')
    brand_type = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='品牌类型(1乐乎2有朋)')
    cooperation_type = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='合作方式(1托管2包租3加盟)')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    is_dispersion = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否分散式')
    apartment_name = Column(String(20), nullable=False, server_default=text("''"), comment='公寓名')
    apartment_number = Column(String(20), nullable=False, server_default=text("''"), comment='公寓编号')
    bottom_price = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='门店保底价')
    province_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='省份ID')
    city_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='城市ID')
    area_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='区域ID')
    zone_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='商圈ID')
    employee_group_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='员工分组表ID')
    address = Column(String(255), nullable=False, server_default=text("''"), comment='公寓地址')
    commercial_tenant_account = Column(String(128), nullable=False, server_default=text("' '"), comment='商户号')
    commercial_tenant_name = Column(String(64), nullable=False, server_default=text("' '"), comment='商户名称')
    longitude = Column(DECIMAL(14, 6), nullable=False, server_default=text("'0.000000'"), comment='经度')
    latitude = Column(DECIMAL(14, 6), nullable=False, server_default=text("'0.000000'"), comment='纬度')
    gmap_longitude = Column(DECIMAL(16, 12), nullable=False, server_default=text("'0.000000000000'"), comment='高德经度')
    gmap_latitude = Column(DECIMAL(16, 12), nullable=False, server_default=text("'0.000000000000'"), comment='高德纬度')
    Intelligent_lock = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否有智能门锁')
    is_open = Column(TINYINT(1), nullable=False, server_default=text("'1'"))
    opening_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否开业(1是,0否)')
    opening_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='开业时间')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    sms_signature = Column(String(64), nullable=False, server_default=text("''"), comment='短信签名')
    apartment_group_id = Column(String(32), nullable=False, server_default=text("' '"), comment='门店组主键')


class ApartmentCostRelation(Base):
    __tablename__ = 'apartment_cost_relation'

    apartment_cost_relation_id = Column(INTEGER(11), primary_key=True)
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店id')
    cost_name = Column(String(64), nullable=False, server_default=text("''"), comment='费用名称')
    price = Column(String(255), nullable=False, server_default=text("''"), comment='价格标准')
    pay_way = Column(String(50), nullable=False, server_default=text("''"), comment='付款方式')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间')


class ApartmentElectricityPrice(Base):
    __tablename__ = 'apartment_electricity_price'

    apartment_electricity_price_id = Column(INTEGER(11), primary_key=True)
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    price = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='电费单价')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class ApartmentGroup(Base):
    __tablename__ = 'apartment_group'

    apartment_group_id = Column(String(32), primary_key=True, server_default=text("''"), comment='门店组主键')
    apartment_group_name = Column(String(255), nullable=False, server_default=text("''"), comment='门店组名称')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(4), server_default=text("'0'"), comment='删除状态(0:未删除,1:已删除)')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class ApartmentIousConf(Base):
    __tablename__ = 'apartment_ious_conf'

    apartment_ious_conf_id = Column(INTEGER(11), primary_key=True)
    apartment_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='门店ID')
    ious_type = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='分期类型(门店分期1，乐乎分期2)')
    ious_scale = Column(DECIMAL(6, 4), nullable=False, server_default=text("'1.0000'"), comment='分期系数')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class ApartmentOfflineApply(Base):
    __tablename__ = 'apartment_offline_apply'

    apartment_offline_apply_id = Column(INTEGER(11), primary_key=True)
    service_code = Column(String(30), nullable=False, server_default=text("'0'"), comment='业务内容')
    employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='管家id')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店id')
    reason = Column(String(255), nullable=False, server_default=text("''"), comment='线下原因')
    reason_detail = Column(MEDIUMTEXT, nullable=False, comment='原因说明')
    room_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='房间id')
    first_agree = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='第一次通过')
    second_agree = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='第二次通过')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class ApartmentOfflinePayment(Base):
    __tablename__ = 'apartment_offline_payment'

    apartment_offline_payment_id = Column(INTEGER(11), primary_key=True)
    bill_detail_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='收支流水表id')
    bill_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='账单')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店id')
    reason = Column(String(100), nullable=False, server_default=text("''"), comment='线下原因')
    reason_detail = Column(MEDIUMTEXT, nullable=False, comment='原因说明')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class ApartmentOfflinePaymentConf(Base):
    __tablename__ = 'apartment_offline_payment_conf'

    apartment_offline_payment_conf_id = Column(INTEGER(11), primary_key=True)
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店id')
    amount = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='次数')
    status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否开通  1开通 0 未开通')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class ApartmentRevenue(Base):
    __tablename__ = 'apartment_revenue'

    apartment_revenue_id = Column(INTEGER(11), primary_key=True)
    cost_configuration_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='科目ID')
    cost_name = Column(String(100), nullable=False, server_default=text("''"), comment='费用名称')
    revenue_type = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='1：门店营收，2：平台营收，3：托管自营')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class ApartmentSalesChange(Base):
    __tablename__ = 'apartment_sales_change'

    apartment_sales_change_id = Column(String(32), primary_key=True, comment='门店销售任务变更主键ID')
    change_record_id = Column(String(32), nullable=False, comment='门店销售任务变更主键ID')
    apartment_sales_task_id = Column(String(32), nullable=False, comment='门店销售任务主键ID')
    organization_id = Column(String(32), nullable=False, server_default=text("'0'"), comment='组织id')
    apartment_id = Column(INTEGER(11), server_default=text("'0'"), comment='门店ID')
    change_time = Column(INTEGER(11), server_default=text("'0'"), comment='变更时间')
    change_employee_id = Column(INTEGER(11), server_default=text("'0'"), comment='变更人')
    change_cause = Column(String(256), nullable=False, server_default=text("''"), comment='变更原因')
    before_change_number = Column(INTEGER(11), server_default=text("'0'"), comment='修改前任务数量')
    after_change_number = Column(INTEGER(11), server_default=text("'0'"), comment='修改后任务数量')
    source = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='来源(1:初始变更 2:中途变更 3:变更确认 )')
    operation_employee_id = Column(INTEGER(11), server_default=text("'0'"), comment='操作人编号')
    create_time = Column(INTEGER(11), server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), server_default=text("'0'"), comment='修改时间')
    delete_status = Column(TINYINT(4), server_default=text("'0'"), comment='删除状态(1:未删除,2:已删除)')
    delete_time = Column(INTEGER(11), server_default=text("'0'"), comment='删除时间')


class ApartmentSalesChangeLog(Base):
    __tablename__ = 'apartment_sales_change_log'

    apartment_sales_change_id = Column(String(32), primary_key=True, comment='门店销售任务变更主键ID')
    change_apartment_id = Column(INTEGER(11), server_default=text("'0'"), comment='变更门店ID')
    change_time = Column(INTEGER(11), server_default=text("'0'"), comment='变更时间')
    change_employee_id = Column(INTEGER(11), server_default=text("'0'"), comment='变更方')
    accept_employee_id = Column(INTEGER(11), server_default=text("'0'"), comment='接受变更方')
    before_change_number = Column(INTEGER(11), server_default=text("'0'"), comment='修改前任务数量')
    after_change_number = Column(INTEGER(11), server_default=text("'0'"), comment='修改后任务数量')
    change_cause = Column(String(256), nullable=False, server_default=text("''"), comment='修改原因')
    type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='来源(1:员工 2:门店 )')
    source = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='来源(1:初始变更 2:中途变更 3:变更确认 )')
    create_time = Column(INTEGER(11), server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), server_default=text("'0'"), comment='修改时间')
    delete_status = Column(TINYINT(4), server_default=text("'0'"), comment='删除状态(1:未删除,2:已删除)')
    delete_time = Column(INTEGER(11), server_default=text("'0'"), comment='删除时间')


class ApartmentSalesJob(Base):
    __tablename__ = 'apartment_sales_job'

    apartment_sales_job_id = Column(String(32), primary_key=True, comment='门店销售工作主键ID')
    apartment_sales_task_id = Column(String(32), nullable=False, comment='门店销售任务主键ID')
    organization_id = Column(String(32), nullable=False, server_default=text("'0'"), comment='组织id')
    apartment_id = Column(INTEGER(11), server_default=text("'0'"), comment='门店ID')
    create_time = Column(INTEGER(11), server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), server_default=text("'0'"), comment='修改时间')
    delete_status = Column(TINYINT(4), server_default=text("'0'"), comment='删除状态(1:未删除,2:已删除)')
    delete_time = Column(INTEGER(11), server_default=text("'0'"), comment='删除时间')


class ApartmentSalesTarget(Base):
    __tablename__ = 'apartment_sales_target'

    id = Column(INTEGER(11), primary_key=True)
    apartment_sales_target_id = Column(String(64), nullable=False, server_default=text("''"), comment='门店月付销售目标ID')
    apartment_name = Column(String(64), nullable=False, server_default=text("''"), comment='门店名字')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    sales_target = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='销售目标')
    is_sales = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='不纳入计算')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='1正常2删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class ApartmentSalesTask(Base):
    __tablename__ = 'apartment_sales_task'

    apartment_sales_task_id = Column(String(32), primary_key=True, comment='门店销售任务主键ID')
    apartment_id = Column(INTEGER(11), server_default=text("'0'"), comment='门店ID')
    organization_id = Column(String(32), nullable=False, server_default=text("'0'"), comment='组织id')
    is_push = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否推送 {1：未推送 2 已推送}')
    start_time = Column(INTEGER(11), server_default=text("'0'"), comment='任务开始时间')
    end_time = Column(INTEGER(11), server_default=text("'0'"), comment='任务结束时间')
    task_number = Column(INTEGER(11), server_default=text("'0'"), comment='销售任务数量')
    status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否锁定 {1：未锁定 2 已锁定}')
    wait_sale_number = Column(INTEGER(11), server_default=text("'0'"), comment='待售房间数量')
    assigned_number = Column(INTEGER(11), server_default=text("'0'"), comment='已分配数量')
    confirmed_number = Column(INTEGER(11), comment='已确认数量')
    no_confirmed_number = Column(INTEGER(11), comment='未确认数量')
    remaining_number = Column(INTEGER(11), comment='剩余数量')
    create_time = Column(INTEGER(11), server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), server_default=text("'0'"), comment='修改时间')
    delete_status = Column(TINYINT(4), server_default=text("'0'"), comment='删除状态(1:未删除,2:已删除)')
    delete_time = Column(INTEGER(11), server_default=text("'0'"), comment='删除时间')


class ApartmentSubjectInfoConfig(Base):
    __tablename__ = 'apartment_subject_info_config'

    subject_info_config_id = Column(String(32), primary_key=True, server_default=text("''"), comment='规则主键')
    subject_info_config_name = Column(String(200), nullable=False, server_default=text("''"), comment='规则名称')
    service_code = Column(String(40), nullable=False, server_default=text("''"), comment='场景CODE')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    finance_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='分期方式:0不分期;1乐乎分期;2门店分期')
    is_payment = Column(INTEGER(1), nullable=False, server_default=text("'0'"), comment='是否是充值缴费')
    operator_id = Column(INTEGER(11), comment='操作人id')


class ApartmentSubjectInfoConfigApartmentRelationship(Base):
    __tablename__ = 'apartment_subject_info_config_apartment_relationship'

    subject_info_config_apartment_relationship_id = Column(String(32), primary_key=True, server_default=text("''"), comment='规则门店主键')
    subject_info_config_id = Column(String(32), index=True, comment='科目规则主键')
    apartment_id = Column(String(32), nullable=False, index=True, server_default=text("''"), comment='门店主键')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    operator_id = Column(INTEGER(11), comment='操作人')


class ApartmentSubjectInfoConfigDetail(Base):
    __tablename__ = 'apartment_subject_info_config_detail'

    subject_info_config_detail_id = Column(String(32), primary_key=True, server_default=text("''"), comment='规则明细主键')
    subject_info_config_id = Column(String(32), nullable=False, index=True, comment='规则主键')
    subject_info_id = Column(INTEGER(11), nullable=False, index=True, comment='科目主键')
    config_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='规则类型1:固定金额2:公式')
    fixation_money = Column(DECIMAL(12, 2), nullable=False, server_default=text("'0.00'"), comment='固定金额数')
    formula_calculate = Column(String(512), nullable=False, server_default=text("'0'"), comment='计算公式')
    calculate_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='计算类型1:一次性2:随账单')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    formula_scale = Column(DECIMAL(12, 2), server_default=text("'0.00'"), comment='公式值')


class ApartmentSubjectPay(Base):
    __tablename__ = 'apartment_subject_pay'

    apartment_subject_pay_id = Column(INTEGER(11), primary_key=True)
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    subject_info_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='科目id')
    subject_name = Column(String(100), nullable=False, server_default=text("''"), comment='科目名称')
    pay_merchant_card_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='银行卡id')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class ApartmentTrading(Base):
    __tablename__ = 'apartment_trading'

    apartment_trading_id = Column(INTEGER(11), primary_key=True, comment='ID')
    apartment_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='门店ID')
    room_id = Column(String(500), nullable=False, server_default=text("''"), comment='房间id')
    rental = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='系统租金')
    money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='成交金额')
    cycle = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='周期')
    type = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='类型:1定金2,入住')
    summary_time = Column(Date, nullable=False, index=True, comment='汇总时间')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class ApiAuthenticate(Base):
    __tablename__ = 'api_authenticate'
    __table_args__ = (
        Index('employee_id', 'tenant_id', 'employee_id'),
    )

    api_authenticate_id = Column(INTEGER(11), primary_key=True)
    company_id_back = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    tenant_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='租客ID')
    employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='员工id')
    api_name = Column(String(50), nullable=False, server_default=text("''"), comment='API名称')
    key = Column(String(255), nullable=False, server_default=text("''"), comment='key')
    secret = Column(String(255), nullable=False, server_default=text("''"), comment='secret')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class ApiLog(Base):
    __tablename__ = 'api_log'

    api_log_id = Column(INTEGER(11), primary_key=True)
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    key = Column(String(255), nullable=False, server_default=text("''"), comment='key')
    secret = Column(String(255), nullable=False, server_default=text("''"), comment='secret')
    token = Column(String(255), nullable=False, server_default=text("''"), comment='token')
    parameter = Column(Text, comment='请求的参数')
    ip = Column(String(255), nullable=False, server_default=text("''"), comment='IP地址')
    request_uri = Column(String(255), nullable=False, server_default=text("''"), comment='http请求参数')
    request_method = Column(String(10), nullable=False, server_default=text("''"), comment='http请求方式')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class ApiToken(Base):
    __tablename__ = 'api_token'
    __table_args__ = (
        Index('token', 'token', 'expires_in'),
        Index('idx_token_isdelete_expiresin_apiauthenticateid', 'token', 'is_delete', 'expires_in', 'api_authenticate_id')
    )

    api_token_id = Column(INTEGER(11), primary_key=True)
    company_id_back = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    api_authenticate_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"))
    token = Column(String(255), nullable=False, server_default=text("''"), comment='token')
    expires_in = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='有效时间')
    app_client = Column(String(20), nullable=False, server_default=text("''"), comment='APP类型')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class App(Base):
    __tablename__ = 'app'

    app_id = Column(INTEGER(11), primary_key=True, comment='APP注册表id')
    type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='APP类型:0 APP 1客户端')
    app_name = Column(String(20), nullable=False, server_default=text("''"), comment='APP名字')
    describe = Column(String(255), nullable=False, server_default=text("''"), comment='APP描述')
    app_key = Column(String(64), nullable=False, server_default=text("''"), comment=' appKey')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class AppHotUpdatePack(Base):
    __tablename__ = 'app_hot_update_pack'

    app_hot_update_pack_id = Column(INTEGER(11), primary_key=True, comment='APP热更新包管理表id')
    pack_name = Column(String(20), nullable=False, server_default=text("''"), comment='升级包名称')
    app_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='APP注册表id')
    native_version = Column(String(20), nullable=False, server_default=text("''"), comment='依赖原生版本')
    react_version = Column(String(20), nullable=False, server_default=text("''"), comment='reactjs版本')
    remark = Column(Text, nullable=False, comment=' 升级说明')
    download_url = Column(String(255), nullable=False, server_default=text("''"), comment='JS包下载地址')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class AppHotUpdateRelease(Base):
    __tablename__ = 'app_hot_update_release'

    app_hot_update_release_id = Column(INTEGER(11), primary_key=True, comment='APP热更新发布id')
    app_hot_update_pack_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='升级包id')
    release_state = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='发布状态 0 未发布 1 发布')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class AppPermissionMenu(Base):
    __tablename__ = 'app_permission_menu'

    app_permission_menu_id = Column(INTEGER(11), primary_key=True)
    menu_resource_id = Column(String(50), nullable=False, server_default=text("''"), comment='uuid')
    name = Column(String(255), nullable=False, server_default=text("''"), comment='app菜单权限')
    parent_permission_menu_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='父菜单ID')
    sort = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='排序')
    ico = Column(String(64), nullable=False, server_default=text("''"), comment='图标')
    url = Column(String(252), nullable=False, server_default=text("''"), comment='跳转地址')
    is_external_link = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否外链')
    organization_id = Column(INTEGER(1), nullable=False, server_default=text("'0'"), comment='组织ID')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class AppletLabel(Base):
    __tablename__ = 'applet_label'

    applet_label_id = Column(String(32), primary_key=True, server_default=text("'小程序标签主键'"))
    applet_label_text = Column(String(32), server_default=text("''"), comment='小程序标签文本')
    search_label_search_count = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='搜索次数')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='1 正常，2 删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))


class Area(Base):
    __tablename__ = 'area'

    area_id = Column(INTEGER(11), primary_key=True, comment='区域ID')
    city_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='城市ID')
    area_name = Column(String(50), nullable=False, server_default=text("''"), comment='区域名')
    longitude = Column(String(255), nullable=False, server_default=text("''"), comment='经度')
    latitude = Column(String(155), nullable=False, server_default=text("''"), comment='纬度')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class Arrear(Base):
    __tablename__ = 'arrears'

    arrears_id = Column(INTEGER(11), primary_key=True)
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    bill_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='账单ID')
    parent_bill_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='父账单ID')
    contract_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='合同ID')
    money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='欠款补收金额')
    remarks = Column(String(255), nullable=False, server_default=text("''"), comment='备注')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class AssetPackage(Base):
    __tablename__ = 'asset_package'

    asset_package_id = Column(INTEGER(11), primary_key=True, comment='资产包ID')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    batch_number = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='批次号')
    contract_ious_id = Column(INTEGER(10), nullable=False, index=True, server_default=text("'0'"), comment='分期合同ID')
    contract_finance_id = Column(String(32), nullable=False, server_default=text("'0'"), comment='合同账单id 现在为contract_bill_detail_id')
    year = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='年')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='更新时间')
    is_delete = Column(TINYINT(1), nullable=False, index=True, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class BankAccount(Base):
    __tablename__ = 'bank_account'

    bank_account_id = Column(INTEGER(11), primary_key=True)
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    name = Column(String(50), nullable=False, server_default=text("''"), comment='核账账户名')
    numbers = Column(String(100), nullable=False, server_default=text("''"), comment='核账账户号')
    type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='账号类型，0：核销；1：退款')
    is_public = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否是公用类型')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class BankCard(Base):
    __tablename__ = 'bank_card'

    bank_card_id = Column(INTEGER(11), primary_key=True)
    bank_card_name = Column(String(100), nullable=False, comment='银行名称')
    bank_no = Column(VARCHAR(20), comment='总行号')
    bank_code = Column(VARCHAR(20), comment='徽商银行卡code')
    is_abroad = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否国外银行')
    is_hot = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否热门')
    is_hsbank = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否是徽商银行卡; 1:是; 2:否')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class BasicsConfig(Base):
    __tablename__ = 'basics_config'

    basics_config_id = Column(String(32), primary_key=True, unique=True)
    royalty_channel = Column(TINYINT(1), comment='分账通道(1 水滴 2 徽商银行)')
    apartment_id = Column(BIGINT(20), comment='门店ID')
    public_trade_service = Column(DECIMAL(10, 4), comment='乐乎交易手续费')
    apartment_trade_service = Column(DECIMAL(10, 4), comment='甲方交易手续费')
    service_merchant_id = Column(String(32), comment='手续费商户ID')
    service_account_type = Column(String(100), comment='手续费账户类型:公共public,门店apartment')
    service_merchant_type = Column(TINYINT(1), server_default=text("'1'"), comment='手续费商户号类型：1:个人 2:企业')
    service_merchant_name = Column(String(32), comment='手续费商户别名')
    service_bank_name = Column(String(100), comment='手续费银行名称')
    service_card_no = Column(String(32), comment='手续费银行卡号MD5')
    royalty_merchant_id = Column(String(32), comment='分账商户ID')
    royalty_account_type = Column(String(100), comment='分账账户类型:公共public,门店apartment')
    royalty_merchant_type = Column(TINYINT(1), server_default=text("'1'"), comment='分账商户号类型：1:个人 2:企业')
    royalty_merchant_name = Column(String(32), comment='分账商户别名')
    royalty_bank_name = Column(String(100), comment='分账银行名称')
    royalty_card_no = Column(String(32), comment='分账银行卡号MD5')
    is_mandatory_refund = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否强制退款 0=非强制退款 1=强制退款')
    mandatory_refund_period = Column(INTEGER(3), server_default=text("'0'"), comment='强制退款期限')
    create_time = Column(INTEGER(10), server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(10), server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(10), server_default=text("'0'"))
    delete_status = Column(TINYINT(1), server_default=text("'1'"), comment='1正常，2删除')
    operator_id = Column(String(32), comment='操作员工id')


class BasicsWithdrawalRecord(Base):
    __tablename__ = 'basics_withdrawal_record'

    basics_withdrawal_record_id = Column(String(32), primary_key=True, unique=True)
    basics_config_id = Column(String(32), nullable=False, server_default=text("''"), comment='分账基础配置id')
    pay_status = Column(INTEGER(2), nullable=False, server_default=text("'1'"), comment='提现状态：1进行中，2成功，3失败')
    pay_merchant_withdraw_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='商户提现表id')
    withdraw_no = Column(String(50), nullable=False, server_default=text("''"), comment='乐乎订单号')
    send_msg = Column(String(500), nullable=False, server_default=text("''"), comment='查询提现失败后发送提醒的内容')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    delete_status = Column(INTEGER(2), nullable=False, server_default=text("'1'"), comment='1正常，2删除')


class Bill(Base):
    __tablename__ = 'bill'

    bill_id = Column(INTEGER(11), primary_key=True, index=True)
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    apartment_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='门店ID')
    order_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='订单id')
    table_name = Column(String(100), nullable=False, server_default=text("''"), comment='产生账单的表名称')
    cash_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='现金金额')
    cash_certificate = Column(String(100), nullable=False, index=True, server_default=text("''"), comment='现金凭证')
    bank_card_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='银行卡开户行ID')
    bank_card_number = Column(String(100), nullable=False, server_default=text("''"), comment='银行卡卡号')
    bank_card_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='银行卡金额')
    bank_card_certificate = Column(String(100), nullable=False, server_default=text("''"), comment='银行卡凭证')
    losses_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='挂账金额')
    losses_certificate = Column(String(100), nullable=False, server_default=text("''"), comment='挂账凭证')
    losses_apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='挂账公寓ID')
    losses_bank_card_number = Column(String(100), nullable=False, server_default=text("''"), comment='挂账银行卡行')
    losses_bank_card_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='挂账开户号')
    losses_bank_card_account = Column(String(100), nullable=False, server_default=text("''"), comment='挂账开户名')
    losses_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='挂账状态')
    alipay_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='支付宝金额')
    alipay_certificate = Column(String(100), nullable=False, server_default=text("''"), comment='支付宝凭证')
    weixin_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='微信金额')
    weixin_certificate = Column(String(100), nullable=False, server_default=text("''"), comment='微信凭证')
    coupon_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='优惠券金额')
    coupon_number = Column(String(100), nullable=False, server_default=text("''"), comment='优惠券码')
    balance_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='租客钱包')
    ious_supplier_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='月份服务方金额')
    ious_supplier_certificate = Column(String(100), nullable=False, server_default=text("' '"), comment='月份服务方凭证')
    transfer_service_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='转让服务费')
    transfer_service_mark = Column(String(100), nullable=False, server_default=text("''"), comment='转让服务费备注说明')
    lehui_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='乐惠金额')
    lehui_certificate = Column(String(100), nullable=False, server_default=text("''"), comment='乐惠凭证')
    spd_qrcode_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='靠浦e付')
    subsidy_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='月付补贴')
    subsidy_certificate = Column(String(100), nullable=False, server_default=text("' '"), comment='月付补贴备注')
    spd_qrcode_certificate = Column(String(100), nullable=False, server_default=text("' '"), comment='靠谱e付备注')
    citic_app_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='中信APP')
    citic_weixin_qrcode_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='中信微信扫码')
    citic_alipay_qrcode_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='中信支付宝扫码')
    spd_weixin_h5_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='浦发微信H5')
    spd_alipay_h5_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='浦发支付宝H5')
    spd_weixin_qrcode_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='浦发微信扫码')
    spd_alipay_qrcode_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='浦发支付宝扫码')
    allinpay_weixin_app_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='云商通APP微信')
    allinpay_weixin_h5_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='云商通微信H5')
    allinpay_weixin_qrcode_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='云商通微信扫码')
    allinpay_alipay_qrcode_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='云商通支付宝扫码')
    allinpay_quick_pay_h5_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='云商通H5快捷支付')
    total_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='总金额')
    real_price = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='实收总额')
    document_number = Column(String(200), nullable=False, index=True, server_default=text("''"), comment='单据号')
    store_billing_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='记账时间')
    check_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='支票转账金额')
    check_remarks = Column(String(255), nullable=False, server_default=text("''"), comment='支票转账备注')
    qianfang_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='前方支付金额')
    qianfang_remarks = Column(String(255), nullable=False, server_default=text("' '"), comment='钱方支付备注')
    bill_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='账单类型(0:收入,1:支出)')
    audit = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否通过日夜审核')
    audit_alone = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否通过单条确定')
    audit_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='夜审核人ID')
    audit_alone_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='单条确定人ID')
    finance_audit = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='财务是否审核')
    finance_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='财务审核人员ID')
    is_clearing = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='结账')
    is_closing = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='关账')
    clearing_employee_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='结账操作人')
    closing_employee_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='关账操作人')
    is_write_off = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='核销状态')
    is_refund = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='退款挂账状态')
    is_reject = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='驳回状态')
    revenue_type = Column(TINYINT(1), nullable=False, server_default=text("'3'"), comment='1：门店营收，2：平台营收，3：托管自营')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class BusinessReport(Base):
    __tablename__ = 'business_report'

    business_report_id = Column(INTEGER(11), primary_key=True, comment='主键ID')
    company_id = Column(INTEGER(11), nullable=False, index=True, comment='公司ID')
    city_id = Column(INTEGER(11), nullable=False, index=True, comment='城市ID')
    apartment_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='门店编号')
    apartment_type = Column(TINYINT(1), nullable=False, index=True, server_default=text("'0'"), comment='门店类型 1-筹开门店 2 运营门店 3 单店门店 ')
    is_preordain = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='预定数量')
    room_count_number = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='房间数量汇总')
    renovation_room_number = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='停用装修房间数量')
    repair_room_number = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='停用维修房间数量')
    hostel_storehouse_number = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='停用宿舍库房房间数量')
    rental_number = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='入住数量')
    night_rent_number = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='产生费用房间数量')
    default_number = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='违约数量')
    check_out_number = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='退房数量')
    contract_renewal_number = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='续签数量（老合同周期≥6）')
    contract_renewal_greater_sixMonth_number = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='续签数量（新、老合同周期≥6）')
    old_contract_number = Column(INTEGER(11), nullable=False, comment='老合同数量(合同到期日期=「统计当日-1」&& 合同周期 ≥ 「6个月」)')
    contract_number = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新签合同数量')
    total_monthly_rent = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='月租金总量')
    total_monthly_service_fee = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='月服务费总量')
    summary_time = Column(Date, nullable=False, index=True, comment='汇总时间')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='更新时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间')
    lease_number = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='招租入住数量')
    hostel_forever_number = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='永久停用房数量')
    contract_old_number = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='老合同数量(没有时间限制)')
    contract_new_number = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='续签新合同(没有时间限制)')
    con_rental_number = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='合同入住数量')


class ChangeRecord(Base):
    __tablename__ = 'change_record'

    change_record_id = Column(String(32), primary_key=True, comment='变更记录主键ID')
    task_type = Column(TINYINT(4), server_default=text("'0'"), comment='变更类型(1:门店,2:员工)')
    organization_id = Column(String(32), nullable=False, server_default=text("'0'"), comment='组织id')
    apartment_id = Column(INTEGER(11), server_default=text("'0'"), comment='门店ID')
    create_time = Column(INTEGER(11), server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), server_default=text("'0'"), comment='修改时间')
    delete_status = Column(TINYINT(4), server_default=text("'0'"), comment='删除状态(1:未删除,2:已删除)')
    delete_time = Column(INTEGER(11), server_default=text("'0'"), comment='删除时间')


class CheckinRecord(Base):
    __tablename__ = 'checkin_record'

    checkin_record_id = Column(VARCHAR(32), primary_key=True, comment='主键uuid')
    contract_id = Column(INTEGER(11), comment='合同id')
    shortrent_card = Column(VARCHAR(32), comment='短租卡号')
    apartment_id = Column(INTEGER(11), comment='门店id')
    room_id = Column(INTEGER(11), comment='房间id')
    tenant_id = Column(INTEGER(11), comment='租客id')
    contract_cycle = Column(INTEGER(11), comment='合同周期(月)')
    begin_time = Column(VARCHAR(10), comment='入住时间')
    create_time = Column(INTEGER(10), server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(10), server_default=text("'0'"), comment='修改时间')
    delete_status = Column(TINYINT(6), server_default=text("'1'"), comment='是否删除(1 正常 2删除)')
    delete_time = Column(INTEGER(10), server_default=text("'0'"), comment='删除时间')


class City(Base):
    __tablename__ = 'city'

    city_id = Column(INTEGER(11), primary_key=True, comment='城市ID')
    province_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='省份ID')
    shorthand = Column(String(20), nullable=False, server_default=text("''"), comment='简写')
    city_name = Column(String(20), nullable=False, server_default=text("''"), comment='名称')
    ip_city_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='ip接口对应的城市ID')
    ip_city_name = Column(VARCHAR(50), nullable=False, comment='ip接口对应的城市名字')
    longitude = Column(DECIMAL(14, 6), nullable=False, server_default=text("'0.000000'"))
    latitude = Column(DECIMAL(14, 6), nullable=False, server_default=text("'0.000000'"))
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class CleanApartmentConf(Base):
    __tablename__ = 'clean_apartment_conf'

    clean_apartment_conf_id = Column(INTEGER(11), primary_key=True)
    apartment_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='门店ID')
    begin_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='开始时间')
    end_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='结束时间')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class CleanTermConf(Base):
    __tablename__ = 'clean_term_conf'

    clean_term_conf_id = Column(INTEGER(11), primary_key=True)
    apartment_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='门店ID')
    term = Column(TINYINT(2), nullable=False, server_default=text("'0'"), comment='期数')
    term_times = Column(TINYINT(2), nullable=False, server_default=text("'0'"), comment='每期保洁张数')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class CleanTermDetail(Base):
    __tablename__ = 'clean_term_detail'

    clean_term_detail_id = Column(INTEGER(11), primary_key=True)
    clean_term_conf_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='保洁期数保洁次数配置ID')
    begin_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='开始时间')
    end_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='结束时间')
    contract_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='合同ID')
    term = Column(TINYINT(2), nullable=False, server_default=text("'0'"), comment='期数')
    apartment_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='门店ID')
    room_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='房间ID')
    detail_status = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='状态 0: 未使用 1: 已使用 2: 作废')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class ClientMessage(Base):
    __tablename__ = 'client_message'

    client_message_id = Column(INTEGER(11), primary_key=True)
    app_name = Column(String(20), nullable=False, server_default=text("''"), comment='lisa-mobile 管家端')
    message_name = Column(String(255), nullable=False, server_default=text("''"), comment='消息名')
    message_main_type = Column(String(20), nullable=False, server_default=text("'TODO'"), comment='主分类消息类型: TODO待办, 枚举值兼容其他业务')
    message_type = Column(String(20), nullable=False, server_default=text("'COMPLAINT'"), comment='类型: COMPLAINT客诉')
    extend_data = Column(Text, comment='扩展信息-json')
    status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='消息状态 0未处理 1已处理')
    processing_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='处理时间')
    processing_user_type = Column(String(20), nullable=False, server_default=text("'EMPLOYEE'"), comment='处理人类型 USER EMPLOYEE')
    processing_user_id = Column(String(500), nullable=False, server_default=text("''"), comment='待处理人id 支持一个或者多个，英文逗号隔开')
    processed_user_id = Column(String(500), nullable=False, server_default=text("''"), comment='已处理人id 支持一个或者多个，英文逗号隔开')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class CommisionApartmentAccount(Base):
    __tablename__ = 'commision_apartment_account'

    commision_apartment_account_id = Column(VARCHAR(32), primary_key=True, comment='提佣账户编号')
    apartment_id = Column(VARCHAR(32), nullable=False, comment='门店ID')
    organization_id = Column(VARCHAR(32), nullable=False, server_default=text("'0'"), comment='组织id')
    payment_account_id = Column(INTEGER(32), comment='付款账户ID')
    receivables_account_id = Column(INTEGER(32), comment='收款账户ID')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), server_default=text("'0'"), comment='修改时间')
    delete_status = Column(TINYINT(4), server_default=text("'0'"), comment='删除状态(1:未删除,2:已删除)')
    delete_time = Column(INTEGER(11), server_default=text("'0'"), comment='删除时间')


class CommisionApartmentRoomDay(Base):
    __tablename__ = 'commision_apartment_room_day'

    commision_apartment_room_avg_id = Column(VARCHAR(32), primary_key=True, server_default=text("''"), comment='ID主键')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店id')
    room_count = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='有效房间数')
    count_date = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='统计日期（天）')
    room_type = Column(INTEGER(1), server_default=text("'1'"), comment='1有效房间，2入住房间')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'2'"), comment='是否存在; 1:是, 2:否')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    delete_time = Column(INTEGER(11), server_default=text("'0'"), comment='删除时间')


class CommisionApartmentRoomMonth(Base):
    __tablename__ = 'commision_apartment_room_month'

    commision_apartment_room_month_id = Column(VARCHAR(32), primary_key=True, server_default=text("''"), comment='ID主键')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店id')
    room_count = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='有效房间数')
    count_date = Column(VARCHAR(50), nullable=False, server_default=text("'0'"), comment='统计日期（月）yyyy-MM')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'2'"), comment='是否存在  1:是, 2:否')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    delete_time = Column(INTEGER(11), server_default=text("'0'"), comment='删除时间')


class CommisionBrandBill(Base):
    __tablename__ = 'commision_brand_bill'

    brand_bill_id = Column(VARCHAR(32), primary_key=True, server_default=text("''"))
    apartment_id = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='门店id')
    city_id = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='城市id')
    isaccrue = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否计提: 1未计提  2已计提')
    accrue_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='计提时间')
    commision = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='佣金')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='创建时间：10位时间戳')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='最后一次修改时间：10位时间戳')
    delete_status = Column(INTEGER(1), nullable=False, server_default=text("'1'"), comment='删除状态：1可用 2删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间：10位时间戳')
    ccl_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='账单计算时间')
    revenue = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='手动输入营收')
    cost = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='手动输入成本')


class CommisionBrandrule(Base):
    __tablename__ = 'commision_brandrule'

    brandrule_id = Column(VARCHAR(32), primary_key=True, server_default=text("''"), comment='品牌规则id')
    apartment_id = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='门店id')
    city_id = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='城市id')
    type = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='类型: 1 固定年费  2利润百分比')
    annual_cost = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='固定年费')
    profit_percent = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='利润百分比')
    rule_start_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='规则开始时间')
    rule_end_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='规则结束时间')
    employee_id = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='操作人')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='创建时间：10位时间戳')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='最后一次修改时间：10位时间戳')
    delete_status = Column(INTEGER(1), nullable=False, server_default=text("'1'"), comment='删除状态：1可用 2删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间：10位时间戳')
    is_old_contract_partake = Column(INTEGER(2), server_default=text("'1'"), comment='导入数据是否参与计算 0是 1否')


class CommisionExcessPerformance(Base):
    __tablename__ = 'commision_excess_performance'

    commision_excess_performance_id = Column(VARCHAR(32), primary_key=True, comment='超额业绩主键ID')
    company_id = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='公司id')
    organization_id = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='组织id')
    city_id = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='城市id')
    apartment_id = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='门店id')
    bill_year_month = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='账单年月时间戳')
    major_revenue_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='主要业绩合计（根据规则配置来，要么是营收要么是利润）')
    room_number = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='月平均房间数')
    excess_profit_point = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='超额收益计提点（从配置规则中读取并保存到=此）')
    divide_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='超额分成金额')
    plan_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否确认计提：1否，2是')
    confirm_date = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='确认计提选择的时间（暂时废弃）')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='1正常，2删除')
    employee_id = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='操作人ID')


class CommisionFinanceConfigure(Base):
    __tablename__ = 'commision_finance_configure'

    commision_finance_configure_id = Column(VARCHAR(32), primary_key=True, comment='超额计提方式主键ID')
    city_id = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='城市id')
    apartment_id = Column(VARCHAR(32), nullable=False, comment='门店ID')
    organization_id = Column(VARCHAR(32), nullable=False, server_default=text("'0'"), comment='组织id')
    commision_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='参与计提金额1：营收 2:利润')
    commision_valid_begin_Time = Column(INTEGER(11), server_default=text("'0'"), comment='规则有效开始时间')
    commision_valid_end_Time = Column(INTEGER(11), server_default=text("'0'"), comment='规则有效结束时间')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    rule_group_id = Column(VARCHAR(32), nullable=False, comment='规则组ID')
    create_time = Column(INTEGER(11), server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), server_default=text("'0'"), comment='修改时间')
    delete_status = Column(TINYINT(4), server_default=text("'0'"), comment='删除状态(1:未删除,2:已删除)')
    delete_time = Column(INTEGER(11), server_default=text("'0'"), comment='删除时间')
    is_old_contract_partake = Column(INTEGER(1), server_default=text("'1'"), comment='老合同是否参与:0参与1不参与')


class CommisionFinanceRule(Base):
    __tablename__ = 'commision_finance_rule'

    commision_finance_rule_id = Column(VARCHAR(32), primary_key=True, comment='超额计提规则主键ID')
    commision_finance_configure_id = Column(VARCHAR(32), nullable=False, comment='超额计提方式主键ID')
    organization_id = Column(VARCHAR(32), nullable=False, server_default=text("'0'"), comment='组织id')
    provision_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='计提点类型(1:固定金额2:按房间量)')
    valid_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='生效类型（1:永久2选定时间段）')
    room_number_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='佣房间数类型值(1:固定房间数，2：平均房间数，3:系统房间数)')
    rule_group_id = Column(VARCHAR(32), nullable=False, comment='规则组ID')
    rule_group_index_id = Column(INTEGER(11), server_default=text("'0'"), comment='规则组序号')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), server_default=text("'0'"), comment='修改时间')
    delete_status = Column(TINYINT(4), server_default=text("'0'"), comment='删除状态(1:未删除,2:已删除)')
    delete_time = Column(INTEGER(11), server_default=text("'0'"), comment='删除时间')
    room_number = Column(INTEGER(11), server_default=text("'0'"), comment='房间量')


class CommisionFinanceRuleDetail(Base):
    __tablename__ = 'commision_finance_rule_detail'

    commision_finance_rule_detail_id = Column(VARCHAR(32), primary_key=True, comment='超额计提规则详情主键ID')
    commision_finance_rule_id = Column(VARCHAR(32), nullable=False, comment='超额计提规则主键ID')
    organization_id = Column(VARCHAR(32), nullable=False, server_default=text("'0'"), comment='组织id')
    commision_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='计提金额')
    commision_proportion = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='计提比例')
    rule_group_id = Column(VARCHAR(32), nullable=False, comment='规则组ID')
    rule_group_index_id = Column(INTEGER(11), server_default=text("'0'"), comment='规则组序号')
    rule_valid_begin_Time = Column(INTEGER(11), server_default=text("'0'"), comment='规则开始时间')
    rule_valid_end_Time = Column(INTEGER(11), server_default=text("'0'"), comment='规则结束时间')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), server_default=text("'0'"), comment='修改时间')
    delete_status = Column(TINYINT(4), server_default=text("'0'"), comment='删除状态(1:未删除,2:已删除)')
    delete_time = Column(INTEGER(11), server_default=text("'0'"), comment='删除时间')


class CommisionPreopenBill(Base):
    __tablename__ = 'commision_preopen_bill'

    preopen_bill_id = Column(VARCHAR(32), primary_key=True, server_default=text("''"))
    apartment_id = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='门店id')
    city_id = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='城市id')
    duration_revenue = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='筹开期营收总额')
    duration_rate = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='筹开期招租率')
    check_type = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='考核类型: 1 营收额 2招租率 3全部')
    type = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否达标：1未达标 2已达标 3已超额')
    isaccrue = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否计提: 1未计提  2已计提')
    accrue_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='计提时间')
    rule_start_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='筹开规则开始时间')
    rule_end_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='筹开规则结束时间')
    reach_revenue = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='达标营收额')
    reach_rate = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='达标招租率')
    over_revenue = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='超额营收额')
    over_rate = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='超额招租率')
    cost_par = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='筹开费用标准/间')
    room_count = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='房间数')
    commision = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='筹开费')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='创建时间：10位时间戳')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='最后一次修改时间：10位时间戳')
    delete_status = Column(INTEGER(1), nullable=False, server_default=text("'1'"), comment='删除状态：1可用 2删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间：10位时间戳')


class CommisionPreopenRevenue(Base):
    __tablename__ = 'commision_preopen_revenue'

    commision_preopen_revenue_id = Column(VARCHAR(32), primary_key=True, comment='营收主表主键ID')
    city_id = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='所在城市ID')
    apartment_id = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='门店ID')
    rule_start_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='筹开规则开始时间')
    rule_end_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='筹开规则结束时间')
    bill_year_month = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='计算年月时间戳')
    total_revenue = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='总营收')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='1正常，2删除')
    total_import_revenue = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='导入营收')


class CommisionPreopenRevenueItem(Base):
    __tablename__ = 'commision_preopen_revenue_item'

    commision_preopen_revenue_item_id = Column(VARCHAR(32), primary_key=True, server_default=text("''"), comment='营收明细id')
    commision_preopen_revenue_id = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='营收主表id')
    commision_subject_id = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='配置的营收科目id')
    revenue_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='营收金额')
    subject_type = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='科目类型：1系统内科目，2自定义科目')
    revenue_day = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='自定义科目营收时间，10位时间戳，精确到日')
    remark = Column(VARCHAR(255), nullable=False, server_default=text("''"), comment='备注')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    delete_status = Column(INTEGER(1), nullable=False, server_default=text("'1'"), comment='1正常，2删除')
    employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人id')
    import_status = Column(INTEGER(2), server_default=text("'1'"), comment='系统科目营收之是否是老合同导入：1否，2是')


class CommisionPreopenrule(Base):
    __tablename__ = 'commision_preopenrule'

    preopenrule_id = Column(VARCHAR(32), primary_key=True, server_default=text("''"), comment='筹开规则id')
    apartment_id = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='门店id')
    city_id = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='城市id')
    reach_revenue = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='达标营收额')
    reach_rate = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='达标招租率')
    reach_commision = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='达标佣金/间')
    over_revenue = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='超额营收额')
    over_rate = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='超额招租率')
    over_commision = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='超额佣金/间')
    rule_start_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='筹开规则开始时间')
    rule_end_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='筹开规则结束时间')
    employee_id = Column(VARCHAR(32), nullable=False, comment='操作人')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='创建时间：10位时间戳')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='最后一次修改时间：10位时间戳')
    delete_status = Column(INTEGER(1), nullable=False, server_default=text("'1'"), comment='删除状态：1可用 2删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间：10位时间戳')
    is_old_contract_partake = Column(INTEGER(2), server_default=text("'1'"), comment='导入数据是否参与计算 0是 1否')


class CommisionRevenue(Base):
    __tablename__ = 'commision_revenue'

    commision_revenue_id = Column(VARCHAR(32), primary_key=True, comment='营收主表主键ID')
    company_id = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='公司ID')
    organization_id = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='组织ID')
    city_id = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='所在城市ID')
    apartment_id = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='门店ID')
    bill_year_month = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='账单年月时间戳')
    total_revenue = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='总营收')
    total_cost = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='总成本')
    total_profit = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='总利润')
    edit_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否可编辑：1可编辑，2不可编辑')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='1正常，2删除')
    employee_id = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='操作人ID')


class CommisionRevenueItem(Base):
    __tablename__ = 'commision_revenue_item'

    commision_revenue_item_id = Column(VARCHAR(32), primary_key=True, server_default=text("''"), comment='营收明细id')
    commision_revenue_id = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='营收主表id')
    commision_subject_id = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='配置的营收科目id')
    revenue_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='营收金额')
    revenue_day = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='自定义科目营收时间，10位时间戳，精确到日')
    remark = Column(VARCHAR(255), nullable=False, server_default=text("''"), comment='备注')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    delete_status = Column(INTEGER(1), nullable=False, server_default=text("'1'"), comment='1正常，2删除')
    employee_id = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='操作人id')
    contract_id = Column(INTEGER(10), server_default=text("'0'"), comment='系统科目营收的合同id')
    service_code = Column(VARCHAR(32), server_default=text("''"), comment='系统科目营收的service_code')
    import_status = Column(INTEGER(1), server_default=text("'1'"), comment='系统科目营收之是否是老合同导入：1否，2是')


class CommisionSale(Base):
    __tablename__ = 'commision_sale'
    __table_args__ = (
        Index('index_commision_sale_apartment_id', 'apartment_id', 'contract_id', 'commision_month', 'commision_money', 'commision_type', 'commision_status'),
    )

    commision_sale_id = Column(VARCHAR(32), primary_key=True, comment='ID主键')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店id')
    room_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='房间id')
    contract_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='合同id')
    commision_type = Column(INTEGER(1), nullable=False, server_default=text("'1'"), comment='提佣类型：1销售提佣，2续租提佣，3违约二次提佣')
    commision_money = Column(DECIMAL(12, 2), nullable=False, server_default=text("'0.00'"), comment='提佣金额')
    commision_status = Column(INTEGER(1), nullable=False, server_default=text("'0'"), comment='结佣状态：1未结佣，2已结佣')
    organization_id = Column(String(32), nullable=False, server_default=text("'0'"), comment='组织ID')
    commision_month = Column(VARCHAR(50), server_default=text("'1970-01'"), comment='该合同的开始日期yyyy-MM格式')
    confirm_status = Column(INTEGER(1), server_default=text("'1'"), comment='计提状态：1未计提，2已计提')
    confirm_date = Column(INTEGER(11), comment='计提时间')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'2'"), comment='是否存在; 1:是, 2:否')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    delete_time = Column(INTEGER(11), server_default=text("'0'"), comment='删除时间')


class CommisionSaleRuleConfig(Base):
    __tablename__ = 'commision_sale_rule_config'

    commision_sale_rule_config_id = Column(VARCHAR(32), primary_key=True, comment='销售提成规则主键ID')
    apartment_id = Column(VARCHAR(32), nullable=False, comment='门店ID')
    organization_id = Column(VARCHAR(32), nullable=False, server_default=text("'0'"), comment='组织id')
    commision_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='提成类型1：按月 2:实时')
    commision_valid_begin_Time = Column(INTEGER(11), server_default=text("'0'"), comment='规则有效开始时间')
    commision_valid_end_Time = Column(INTEGER(11), server_default=text("'0'"), comment='规则有效结束时间')
    rule_group_id = Column(VARCHAR(32), nullable=False, comment='规则组ID')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), server_default=text("'0'"), comment='修改时间')
    delete_status = Column(TINYINT(4), server_default=text("'0'"), comment='删除状态(1:未删除,2:已删除)')
    delete_time = Column(INTEGER(11), server_default=text("'0'"), comment='删除时间')
    is_old_contract_partake = Column(INTEGER(2), server_default=text("'1'"), comment='导入数据是否参与计算 0是 1否')


class CommisionSaleRuleDetail(Base):
    __tablename__ = 'commision_sale_rule_detail'

    commision_sale_rule_detail_id = Column(VARCHAR(32), primary_key=True, comment='超额计提方式详情主键ID')
    sale_commision_rule_id = Column(VARCHAR(32), nullable=False, comment='销售提成规则主键ID')
    organization_id = Column(VARCHAR(32), nullable=False, server_default=text("'0'"), comment='组织id')
    commision_detail_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='销售提成类型1：销售提成 2:续租提成3:违约二次销售提成')
    sale_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='销售类型1：固定金额 2:租金比例')
    sale_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='销售提成金额')
    sale_proportion = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='销售提成比例')
    default_days = Column(INTEGER(11), server_default=text("'0'"), comment='违约天数')
    rule_group_id = Column(VARCHAR(32), nullable=False, comment='规则组ID')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), server_default=text("'0'"), comment='修改时间')
    delete_status = Column(TINYINT(1), server_default=text("'0'"), comment='删除状态(1:未删除,2:已删除)')
    delete_time = Column(INTEGER(11), server_default=text("'0'"), comment='删除时间')


class CommisionSettlementItem(Base):
    __tablename__ = 'commision_settlement_item'
    __table_args__ = (
        Index('apartment_id', 'apartment_id', 'project_type'),
    )

    commision_settlement_item_id = Column(VARCHAR(32), primary_key=True, comment='结佣明细主键ID')
    company_id = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='公司id')
    organization_id = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='组织ID')
    city_id = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='城市ID')
    apartment_id = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='门店id')
    project_type = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='项目类型：1托管费用，2品牌佣金，3超额佣金，4销售佣金，5有朋佣金，6筹开')
    auto_type = Column(TINYINT(1), server_default=text("'2'"), comment='是否自动结佣：1是，2否，默认为否（若为是，每天凌晨自动转账）')
    project_type_name = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='项目类型名称')
    settlement_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='应结算金额/结佣金额')
    settlemented_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='已结算金额')
    settlement_day = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='应结时间（确认计提时选择的日期）[暂时废弃]')
    bill_start_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='计提周期开始时间（账单开始时间）')
    bill_end_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='计提周期结束时间（账单结束时间）')
    settlement_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='结佣状态：1待结佣，2结佣中，3部分结佣，4全部结佣，5结佣失败，6到账异常（如金额不对等）')
    settlement_mode = Column(TINYINT(1), server_default=text("'0'"), comment='结佣方式：1线上结佣，2线下结佣')
    transfer_remark = Column(VARCHAR(255), server_default=text("''"), comment='转账失败或异常的备注')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='1正常，2已删除')
    employee_id = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='操作人ID')


t_commision_settlement_transfer = Table(
    'commision_settlement_transfer', metadata,
    Column('commision_settlement_item_id', VARCHAR(32), nullable=False, server_default=text("''"), comment='提佣明细ID'),
    Column('commision_transfer_record_id', VARCHAR(32), nullable=False, server_default=text("''"), comment='提佣转账记录ID'),
    Column('create_time', INTEGER(10), nullable=False, server_default=text("'0'")),
    Column('update_time', INTEGER(10), server_default=text("'0'")),
    Column('delete_time', INTEGER(10), server_default=text("'0'")),
    Column('delete_status', TINYINT(1), server_default=text("'1'"), comment='1正常，2删除'),
    Column('employee_id', VARCHAR(32), server_default=text("''"), comment='操作人id')
)


class CommisionSubject(Base):
    __tablename__ = 'commision_subject'

    commision_subject_id = Column(VARCHAR(32), primary_key=True, comment='营收科目ID')
    company_id = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='公司id')
    organization_id = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='组织id')
    apartment_id = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='门店id')
    apartment_name = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='门店名称')
    subject_code = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='科目code')
    subject_name = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='科目名称')
    subject_type = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='科目类型：1系统内科目，2自定义科目')
    revenue_type = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='营收类型：1收入，2成本支出')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='删除状态：1正常，2删除')
    employee_id = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='操作人ID')
    city_id = Column(VARCHAR(32), nullable=False, comment='城市id')
    city_name = Column(VARCHAR(255), nullable=False, comment='城市名称')


class CommisionTransferRecord(Base):
    __tablename__ = 'commision_transfer_record'

    commision_transfer_record_id = Column(VARCHAR(32), primary_key=True, comment='提佣转账记录表主键id')
    transfer_amount = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='转账总金额')
    receive_amount = Column(DECIMAL(10, 2), server_default=text("'0.00'"), comment='到账金额')
    payment_account_id = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='付款账户ID')
    receivables_account_id = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='收款账户ID')
    transfer_status = Column(TINYINT(1), server_default=text("'0'"), comment='状态：0新建记录，1成功，2失败，3异常（如金额不对）')
    transfer_remark = Column(VARCHAR(255), nullable=False, server_default=text("''"), comment='备注（若转账失败的原因备注）')
    payment_time = Column(INTEGER(10), server_default=text("'0'"), comment='到账时间')
    employee_id = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='操作人')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='1正常，2删除')
    delete_time = Column(INTEGER(10), server_default=text("'0'"))


class CommisionTrustee(Base):
    __tablename__ = 'commision_trustee'

    commision_trustee_id = Column(VARCHAR(32), primary_key=True, comment='ID主键')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店id')
    trustee_price = Column(DECIMAL(12, 2), nullable=False, server_default=text("'0.00'"), comment='托管费单价')
    trustee_room_count = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='托管房间数（如果是选择系统房间数，则求月房间数平均）')
    trustee_income = Column(DECIMAL(12, 2), nullable=False, server_default=text("'0.00'"), comment='当前管理费收入')
    trustee_month = Column(VARCHAR(50), nullable=False, server_default=text("'1970-01'"), comment='托管月周期： yyyy-MM')
    commision_status = Column(INTEGER(1), nullable=False, server_default=text("'0'"), comment='结佣状态：1未结佣，2已结佣')
    operate_years = Column(VARCHAR(200), server_default=text("'0'"), comment='截止当前已运营年限')
    confirm_date = Column(INTEGER(11), server_default=text("'0'"), comment='确认计提时间')
    confirm_status = Column(INTEGER(1), server_default=text("'1'"), comment='计提状态：1未计提，2已计提')
    organization_id = Column(String(32), nullable=False, server_default=text("'0'"), comment='组织ID')
    adjust_number = Column(DECIMAL(12, 2), server_default=text("'0.00'"), comment='调整值，用于计算管理费合计')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'2'"), comment='是否存在; 1:是, 2:否')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    delete_time = Column(INTEGER(11), server_default=text("'0'"), comment='删除时间')


class CommisionTrusteeDetail(Base):
    __tablename__ = 'commision_trustee_detail'

    commision_trustee_detail_id = Column(VARCHAR(32), primary_key=True, comment='ID主键')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店id')
    trustee_price = Column(DECIMAL(12, 2), nullable=False, server_default=text("'0.00'"), comment='托管费单价')
    trustee_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='托管时间周期，时间戳')
    trustee_type = Column(INTEGER(1), nullable=False, comment='托管收取类型： 1：交租，2：退租')
    room_id = Column(INTEGER(10), nullable=False, comment='房间id')
    tenant_name = Column(VARCHAR(200), nullable=False, comment='租客姓名')
    tenant_month = Column(INTEGER(10), nullable=False, comment='租期（月）')
    operate_years = Column(VARCHAR(200), server_default=text("''"), comment='已运营年限')
    commision_status = Column(INTEGER(1), nullable=False, server_default=text("'0'"), comment='结佣状态：1未结佣，2已结佣')
    confirm_date = Column(INTEGER(11), server_default=text("'0'"), comment='确认计提时间')
    confirm_status = Column(INTEGER(1), server_default=text("'1'"), comment='计提状态：1未计提，2已计提')
    organization_id = Column(String(32), nullable=False, server_default=text("'0'"), comment='组织ID')
    trustee_fee = Column(DECIMAL(12, 2), server_default=text("'0.00'"))
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'2'"), comment='是否存在; 1:是, 2:否')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    delete_time = Column(INTEGER(11), server_default=text("'0'"), comment='删除时间')


class CommisionTrusteeshipRule(Base):
    __tablename__ = 'commision_trusteeship_rule'

    commision_trusteeship_rule_id = Column(VARCHAR(32), primary_key=True, comment='托管规则ID')
    apartment_id = Column(VARCHAR(32), nullable=False, comment='门店ID')
    organization_id = Column(VARCHAR(32), nullable=False, server_default=text("'0'"), comment='组织id')
    trusteeship_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='提佣时点1:按月2:实时收取')
    commission_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='计佣方式:1:固定房间数，2：平均房间数3 :按照租金')
    trusteeship_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='托管金额')
    trusteeship_room_number = Column(INTEGER(11), server_default=text("'0'"), comment='托管房间数量')
    adjust_number = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='调整数')
    rule_valid_begin_Time = Column(INTEGER(11), server_default=text("'0'"), comment='规则开始时间')
    rule_valid_end_Time = Column(INTEGER(11), server_default=text("'0'"), comment='规则结束时间')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), server_default=text("'0'"), comment='修改时间')
    delete_status = Column(TINYINT(4), server_default=text("'0'"), comment='删除状态(1:未删除,2:已删除)')
    delete_time = Column(INTEGER(11), server_default=text("'0'"), comment='删除时间')
    scale_coefficient = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='规模系数')
    is_old_contract_partake = Column(INTEGER(2), server_default=text("'1'"), comment='导入数据是否参与计算 0是 1否')


class CommissionApartmentOrder(Base):
    __tablename__ = 'commission_apartment_order'
    __table_args__ = (
        Index('sale_date_apartment_id', 'sale_date', 'apartment_id', unique=True),
    )

    id = Column(INTEGER(11), primary_key=True)
    sale_date = Column(INTEGER(11), nullable=False, comment='销售日期')
    apartment_id = Column(INTEGER(11), nullable=False, comment='门店id')
    preordain_order = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='预定单量')
    contract_order = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='直签单量')
    renew_order = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='续租单量')
    create_time = Column(INTEGER(11), server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), server_default=text("'0'"), comment='更新时间')
    delete_time = Column(INTEGER(11), server_default=text("'0'"), comment='删除时间')
    is_delete = Column(INTEGER(11), server_default=text("'0'"), comment='删除状态')


class CommissionCityDetailDay(Base):
    __tablename__ = 'commission_city_detail_day'
    __table_args__ = (
        Index('date_time_region_city_id', 'city_id', 'region', 'date_time', 'type', unique=True),
    )

    id = Column(INTEGER(11), primary_key=True)
    city_id = Column(INTEGER(11), nullable=False, comment='城市id')
    region = Column(INTEGER(11), nullable=False, comment='区域id')
    prepare_reach = Column(INTEGER(11), comment='筹开达成')
    operation_reach = Column(INTEGER(11), comment='运营达成')
    yy_reach = Column(INTEGER(11), comment='有朋达成')
    yy_we_reach = Column(DECIMAL(10, 0), comment='有朋我方达成')
    yy_party_a_reach = Column(DECIMAL(10, 0), comment='有朋甲方达成')
    trusteeship_reach = Column(INTEGER(11), comment='托管达成')
    date_time = Column(INTEGER(11), nullable=False, comment='城市单量日期')
    create_time = Column(INTEGER(11), nullable=False, comment='日期抽取时间')
    update_time = Column(INTEGER(11), comment='更新时间')
    is_delete = Column(INTEGER(11), server_default=text("'0'"), comment='是否删除（0、未删1、删除）')
    delete_time = Column(INTEGER(11), comment='删除时间')
    total = Column(INTEGER(11), comment='累计达成')
    type = Column(INTEGER(11), comment='1、直签2、预定转入住3、续签')


class CommissionConfirmDate(Base):
    __tablename__ = 'commission_confirm_date'

    confirm_date_id = Column(VARCHAR(32), primary_key=True, server_default=text("''"), comment='主键id')
    apartment_id = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='门店id')
    begin_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='账单开始时间')
    end_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='账单结束时间')
    confirm_day = Column(INTEGER(4), nullable=False, server_default=text("'0'"), comment='结算日期(保存天)')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='更新时间')
    delete_status = Column(INTEGER(1), nullable=False, server_default=text("'1'"), comment='删除状态：1可用 2删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间')


class CommissionRule(Base):
    __tablename__ = 'commission_rule'

    commission_rule_id = Column(String(32), primary_key=True)
    rule_category_id = Column(String(32), nullable=False, server_default=text("'0'"), comment='规则分组id')
    start_count = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='销售量起始范围')
    end_count = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='销售量截止范围')
    apartment_id = Column(INTEGER(10), comment='适用门店id')
    commission_money = Column(DECIMAL(12, 2), nullable=False, server_default=text("'0.00'"), comment='每单提成金额')
    reach_standard_money = Column(DECIMAL(12, 2), nullable=False, server_default=text("'0.00'"), comment='达标奖金')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='创建时间：10位时间戳')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='最后一次修改时间：10位时间戳')
    delete_status = Column(INTEGER(1), nullable=False, server_default=text("'1'"), comment='删除状态：1存在2删除')
    delete_time = Column(INTEGER(10), server_default=text("'0'"), comment='删除时间：10位时间戳')


class Company(Base):
    __tablename__ = 'company'

    company_id = Column(INTEGER(11), primary_key=True, comment='公司ID')
    company_name = Column(String(50), nullable=False, server_default=text("''"), comment='公司名称')
    company_alias = Column(String(20), nullable=False, server_default=text("''"), comment='公司别名')
    company_icon = Column(String(50), nullable=False, server_default=text("''"), comment='公司图标')
    company_info = Column(String(255), nullable=False, server_default=text("''"), comment='公司简介')
    organization_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='组织ID')
    pattern = Column(CHAR(2), nullable=False, server_default=text("'0'"), comment='租赁模式(10：集中式，01：分散式，00：没有；11：都有)')
    linkman = Column(String(12), nullable=False, server_default=text("''"), comment='联系人')
    city_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='城市ID')
    phone = Column(String(22), nullable=False, server_default=text("''"), comment='联系方式')
    domain_prefix = Column(String(100), nullable=False, server_default=text("''"), comment='域名前缀')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class CompanyRegion(Base):
    __tablename__ = 'company_region'

    company_region_id = Column(INTEGER(11), primary_key=True, comment='主键ID')
    company_region_name = Column(String(32), nullable=False, server_default=text("''"), comment='公司区域名称')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='更新时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间')


class CompanyRegionCityRelation(Base):
    __tablename__ = 'company_region_city_relation'

    company_region_city_relation_id = Column(String(32), primary_key=True, server_default=text("''"), comment='主键ID')
    company_region_id = Column(String(32), nullable=False, server_default=text("''"), comment='公司区域主键')
    city_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='城市主键')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='更新时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间')


class CompanyRegionRelation(Base):
    __tablename__ = 'company_region_relation'
    __table_args__ = (
        Index('fx_apartment_id_region_city', 'apartment_id', 'company_region_id', 'city_id'),
    )

    company_region_Relation_id = Column(INTEGER(11), primary_key=True, comment='主键ID')
    company_region_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司区域编号')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店编号')
    city_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='城市ID')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='更新时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间')


class Contract(Base):
    __tablename__ = 'contract'
    __table_args__ = (
        Index('is_surrender', 'is_surrender', 'surrender_time'),
    )

    contract_id = Column(INTEGER(11), primary_key=True)
    company_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='公司ID')
    contract_number = Column(String(100), nullable=False, comment='合同编号')
    contract_uuid = Column(String(32), nullable=False, server_default=text("''"), comment='合同UUID')
    room_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='房间ID')
    bill_id = Column(VARCHAR(64), nullable=False, index=True, server_default=text("'0'"), comment='账单表ID')
    begin_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='合同开始时间')
    end_time = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='合同结束时间')
    deposit = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='押金')
    rental = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='租金')
    discount = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='租金折扣比例')
    term = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='交租到第几期')
    ious = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否金融白条')
    ious_number = Column(String(255), nullable=False, server_default=text("''"), comment='金融白条合同号')
    how_mortgage = Column(TINYINT(2), nullable=False, server_default=text("'0'"), comment='押几')
    how_pay = Column(TINYINT(2), nullable=False, server_default=text("'0'"), comment='付几')
    how_day = Column(TINYINT(2), nullable=False, server_default=text("'0'"), comment='付几天')
    is_continue = Column(TINYINT(1), nullable=False, index=True, server_default=text("'0'"), comment='是否续租')
    is_surrender = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否退租')
    surrender_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='退租时间')
    is_reservation_surrender = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否预退')
    reservation_surrender_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='预退时间')
    sales_sources_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='销售渠道ID')
    paid_day = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='已缴费到哪天')
    advance_pay_rent_day = Column(TINYINT(2), nullable=False, server_default=text("'0'"), comment='提前缴租天数')
    renewal_contract = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='续签合同ID')
    switch_contract_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='换房合同ID')
    room_card = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='房卡数')
    remarks = Column(Text, comment='跟进备注')
    fdd_id = Column(String(100), nullable=False, server_default=text("'0'"), comment='法大大id')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, index=True, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    effective_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='1有效，2未生效，3失效')
    sign_type = Column(Enum('fdd', 'ssq', 'hq'), nullable=False, server_default=text("'fdd'"), comment='签约类型: fdd:法大大; ssq:上上签;hq和签;')
    sign_source = Column(Enum('lisa', 'mobile'), nullable=False, server_default=text("'lisa'"), comment='签约来源: lisa:Lisa; mobile:M站;')
    is_sign = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否签约: 0:未签约; 1:已签约;')
    delivery_id = Column(String(32), nullable=False, server_default=text("''"), comment='物业交割单ID')
    is_new = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否新签')
    shortrent_card = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='短租卡号')
    contract_cycle = Column(TINYINT(3), nullable=False, server_default=text("'0'"), comment='合同周期')
    service_fee = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='服务费')
    import_status = Column(INTEGER(1), server_default=text("'1'"), comment='是否是导入的数据：1否，2是')
    is_allow_renewal = Column(TINYINT(1), nullable=False, server_default=text("'2'"), comment='1：允许续租2：不允许续租3:允许续租+短租')
    service_fee_rule = Column(INTEGER(255), server_default=text("'0'"), comment='服务费计费类型1、一次性固定金额收取 2、随账单固定金额收取3、一次性全合同收取固定金额')
    rent_type = Column(TINYINT(2), nullable=False, server_default=text("'1'"), comment='1月租2日租')
    is_sublet = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='转租状态:0默认 1 转租 2取消转租')
    record_status = Column(INTEGER(1), server_default=text("'0'"), comment='是否已备案，0未备案，1已备案，2已注销')
    remark = Column(String(128), server_default=text("''"), comment='备注，主要存储合同备案注销原因描述')
    cancel_record_reason = Column(INTEGER(1), server_default=text("'0'"), comment='注销备案的原因')
    trade_id = Column(String(64), server_default=text("''"))


class ContractControl(Base):
    __tablename__ = 'contract_control'

    contract_control_id = Column(INTEGER(11), primary_key=True)
    control_name = Column(String(60), nullable=False, server_default=text("''"), comment='控件名称')
    control_code = Column(String(60), nullable=False, server_default=text("''"), comment='控件CODE（唯一）')
    default_value = Column(MEDIUMTEXT, nullable=False, comment='控件默认值')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class ContractFinance(Base):
    __tablename__ = 'contract_finance'

    contract_finance_id = Column(INTEGER(11), primary_key=True)
    company_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='公司ID')
    contract_id = Column(INTEGER(10), nullable=False, index=True, server_default=text("'0'"), comment='合同ID')
    contract_ious_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='分期合同表ID')
    is_ious = Column(TINYINT(1), nullable=False, index=True, server_default=text("'0'"), comment='是否月付')
    bill_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='账单ID')
    term = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='第几期')
    begin_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='账单开始日')
    end_time = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='账单结束日')
    pay_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='支付时间')
    is_pay = Column(TINYINT(1), nullable=False, index=True, server_default=text("'0'"), comment='是否支付')
    is_ious_pay = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否分期支付')
    pay_group = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='支付分组')
    rental = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='租金')
    service_fee = Column(Float(10, True), nullable=False, server_default=text("'0.00'"), comment='服务费')
    remarks = Column(Text, comment='备注')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, index=True, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    effective_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='1有效，2未生效，3失效')


class ContractImportLog(Base):
    __tablename__ = 'contract_import_log'

    contract_import_log_id = Column(INTEGER(11), primary_key=True, comment='ID')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    ridgepole_name = Column(String(50), nullable=False, server_default=text("''"), comment='楼栋')
    room_number = Column(String(50), nullable=False, server_default=text("''"), comment='房间号')
    name = Column(String(50), nullable=False, server_default=text("''"), comment='姓名')
    gender = Column(String(50), nullable=False, server_default=text("''"), comment='性别')
    phone = Column(String(50), nullable=False, server_default=text("''"), comment='电话')
    idcard_type = Column(String(50), nullable=False, server_default=text("''"), comment='证件类型')
    idcard = Column(String(50), nullable=False, server_default=text("''"), comment='证件号')
    emergency_contact = Column(String(50), nullable=False, server_default=text("''"), comment='紧急联系人')
    relation = Column(String(50), nullable=False, server_default=text("''"), comment='紧急联系人关系')
    emergency_phone = Column(String(50), nullable=False, server_default=text("''"), comment='紧急联系人电话')
    contract_number = Column(String(50), nullable=False, server_default=text("''"), comment='合同编号')
    begin_time = Column(String(50), nullable=False, server_default=text("''"), comment='入住日期')
    contract_cycle = Column(String(50), nullable=False, server_default=text("''"), comment='合同周期')
    how_mortgage = Column(String(50), nullable=False, server_default=text("''"), comment='压')
    how_pay = Column(String(50), nullable=False, server_default=text("''"), comment='付')
    rental = Column(String(50), nullable=False, server_default=text("''"), comment='租金')
    deposit = Column(String(50), nullable=False, server_default=text("''"), comment='押金')
    paid_term = Column(String(50), nullable=False, server_default=text("''"), comment='已付周期')
    status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='状态 0失败，1成功')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    message = Column(String(255), nullable=False, server_default=text("''"), comment='信息')
    service_fee = Column(String(50))
    service_type = Column(String(100))
    is_service = Column(String(50))


class ContractIou(Base):
    __tablename__ = 'contract_ious'

    contract_ious_id = Column(INTEGER(11), primary_key=True)
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    tenant_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='租客ID')
    contract_ious_number = Column(String(100), nullable=False, server_default=text("''"), comment='分期月付合同号')
    bill_id = Column(String(64), nullable=False, index=True, server_default=text("'0'"), comment='账单ID')
    contract_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='合同ID')
    current_term = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='当前第几期')
    begin_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='首期开始日期')
    ious_tote = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='分期月付期数')
    is_surrender_register = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否退款登记')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, index=True, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    sign_type = Column(Enum('fdd', 'ssq'), nullable=False, server_default=text("'fdd'"), comment='签约类型: fdd:法大大; ssq:上上签;')
    sign_source = Column(Enum('lisa', 'mobile', 'app'), nullable=False, server_default=text("'lisa'"), comment='签约来源: lisa:Lisa; mobile:M站; app:APP;')
    is_sign = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否签约: 0:未签约; 1:已签约;')
    fdd_id = Column(String(100), nullable=False, server_default=text("''"), comment='法大大ID')
    bill_id_copy = Column(String(64), nullable=False, server_default=text("'0'"), comment='账单ID')
    paid_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否打款(0 未打款 1 已打款)')
    ious_type = Column(TINYINT(1), nullable=False, server_default=text("'2'"), comment='1.泛乐白条； 2.乐乎金捷')
    use_range = Column(INTEGER(2), nullable=False, server_default=text("'0'"), comment='第一期/第一个月是否使用优惠券：0未使用，1使用首月类型，2使用账单周期类型')
    real_discount_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='第一期使用优惠券实际优惠的金额')


t_contract_list = Table(
    'contract_list', metadata,
    Column('province_id', INTEGER(11), server_default=text("'0'")),
    Column('city_id', INTEGER(11), server_default=text("'0'")),
    Column('apartment_name', String(20)),
    Column('is_surrender', TINYINT(1), server_default=text("'0'")),
    Column('renewal_contract', INTEGER(11), server_default=text("'0'")),
    Column('room_number', String(20)),
    Column('room_id', INTEGER(11), server_default=text("'0'")),
    Column('front_rental', DECIMAL(10, 2), server_default=text("'0.00'")),
    Column('contract_id', INTEGER(11), server_default=text("'0'")),
    Column('rental', DECIMAL(10, 2), server_default=text("'0.00'")),
    Column('begin_time', INTEGER(11), server_default=text("'0'")),
    Column('surrender_time', INTEGER(11), server_default=text("'0'")),
    Column('end_time', INTEGER(11), server_default=text("'0'")),
    Column('final_end_time', BIGINT(11), server_default=text("'0'"))
)


class ContractPayRelationship(Base):
    __tablename__ = 'contract_pay_relationship'

    contract_pay_relationship_id = Column(INTEGER(11), primary_key=True, comment='合同账单支付关系扩展表id')
    contract_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='合同id')
    tenant_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='租客ID')
    is_ious = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否是分期')
    contract_ious_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='分期id')
    term = Column(String(50), nullable=False, server_default=text("''"), comment='分期月份')
    status = Column(TINYINT(4), nullable=False, server_default=text("'0'"), comment='支付状态状态; 0：未成功; 1：成功')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class ContractPrintLog(Base):
    __tablename__ = 'contract_print_log'

    contract_print_log_id = Column(INTEGER(11), primary_key=True, comment='合同打印记录id')
    contract_id = Column(INTEGER(10), nullable=False, server_default=text("'11'"), comment='合同id')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='最后操作人')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')


t_contract_return_visit_status = Table(
    'contract_return_visit_status', metadata,
    Column('contract_id', INTEGER(11), nullable=False, server_default=text("'0'"), comment='合同ID'),
    Column('status', TINYINT(1), nullable=False, server_default=text("'1'"), comment='回访状态: 1 待回访；2: 已回访；3 未成功'),
    Column('company_id', INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
)


class ContractScheme(Base):
    __tablename__ = 'contract_scheme'

    scheme_id = Column(INTEGER(11), primary_key=True)
    scheme_name = Column(String(255), nullable=False, server_default=text("''"), comment='方案名称')
    is_system = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否系统默认')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人id')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class ContractSchemePayment(Base):
    __tablename__ = 'contract_scheme_payment'

    scheme_payment_id = Column(INTEGER(11), primary_key=True)
    scheme_id = Column(INTEGER(11), nullable=False, index=True, comment='合同方案ID')
    service_code = Column(String(100), nullable=False, index=True, server_default=text("''"), comment='业务CODE')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    apartment_name = Column(String(100), nullable=False, server_default=text("''"), comment='门店名称')
    deposit_month = Column(TINYINT(2), nullable=False, server_default=text("'0'"), comment='押金支付月份')
    rent_month = Column(TINYINT(2), nullable=False, server_default=text("'0'"), comment='租金支付月份')
    discount_scale = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='租金系数')
    is_default = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否默认')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class ContractSchemeTerm(Base):
    __tablename__ = 'contract_scheme_term'

    scheme_term_id = Column(INTEGER(11), primary_key=True)
    scheme_id = Column(INTEGER(11), nullable=False, index=True, comment='合同方案ID')
    service_code = Column(String(100), nullable=False, index=True, server_default=text("''"), comment='业务CODE')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    apartment_name = Column(String(100), nullable=False, server_default=text("''"), comment='门店名称')
    scheme_term = Column(TINYINT(3), nullable=False, server_default=text("'0'"), comment='合同期数(月)')
    discount_scale = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='租金系数')
    is_default = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否默认')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class ContractSnapshot(Base):
    __tablename__ = 'contract_snapshot'
    __table_args__ = (
        Index('idx_contractsnapshottime_companyid', 'contract_snapshot_time', 'company_id'),
    )

    contract_snapshot_id = Column(INTEGER(11), primary_key=True, comment='合同日志表ID')
    contract_id = Column(INTEGER(11), server_default=text("'0'"), comment='合同ID')
    contract_number = Column(String(100), server_default=text("''"), comment='合同编号')
    contract_snapshot_time = Column(INTEGER(11), server_default=text("'0'"), comment='快照时间')
    room_id = Column(INTEGER(11), server_default=text("'0'"), comment='房间ID')
    room_number = Column(String(20), server_default=text("''"), comment='房间编号')
    apartment_id = Column(INTEGER(11), index=True, server_default=text("'0'"), comment='门店ID')
    tenant_id = Column(INTEGER(11), server_default=text("'0'"), comment='租客ID')
    name = Column(String(16), server_default=text("''"), comment='租客姓名')
    phone = Column(String(11), server_default=text("''"), comment='手机号')
    idcard = Column(String(100), server_default=text("''"), comment='证件号')
    pay_type = Column(String(16), server_default=text("''"), comment='押付方式')
    room_rental = Column(DECIMAL(10, 2), server_default=text("'0.00'"), comment='房间租金')
    preordain_money = Column(DECIMAL(10, 2), server_default=text("'0.00'"), comment='订金')
    receivable_money = Column(DECIMAL(10, 2), server_default=text("'0.00'"), comment='应收')
    ueto_employee_name = Column(String(16), server_default=text("''"), comment='上户名')
    with_employee_name = Column(String(16), server_default=text("''"), comment='带户名')
    transaction_date = Column(Date, nullable=False, comment='交易日期')
    store_billing_time = Column(Date, nullable=False, comment='记账日期')
    begin_time = Column(Date, nullable=False, comment='合同开始时间')
    end_time = Column(Date, nullable=False, comment='合同结束时间')
    plan_time = Column(Date, nullable=False, comment='交租计划')
    paid_day = Column(Date, nullable=False, comment='已交租到')
    nex_pay_time = Column(Date, nullable=False, comment='下个交租日期')
    term = Column(SMALLINT(5), server_default=text("'0'"), comment='交租到第几期')
    reservation_surrender_time = Column(Date, nullable=False, comment='预退计划')
    is_reservation_surrender = Column(TINYINT(1), server_default=text("'0'"), comment='是否预退')
    is_surrender = Column(TINYINT(1), server_default=text("'0'"), comment='是否退租')
    surrender_time = Column(Date, comment='退租时间')
    reminder_time = Column(Date, comment='崔租记录')
    remarks = Column(Text, comment='备注')
    status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='合同状态; 1:入住中，2:预退中，3:已经退租')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司id')


class ContractSubjectInfoConfigRelationship(Base):
    __tablename__ = 'contract_subject_info_config_relationship'

    id = Column(INTEGER(11), primary_key=True)
    contract_subject_info_config_relationship_id = Column(String(32), nullable=False, server_default=text("''"), comment='组件ID')
    contract_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='合同ID')
    subject_info_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='科目ID')
    config_type = Column(TINYINT(2), nullable=False, server_default=text("'0'"), comment='规则类型1:固定金额2:公式')
    formula_calculate = Column(String(512), nullable=False, server_default=text("''"), comment='计算公式')
    calculate_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='计算类型1:一次性2:随账单,3任意时间调取,4随合同一次性')
    fixation_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='固定金额')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人ID')


class ContractSublet(Base):
    __tablename__ = 'contract_sublet'

    id = Column(INTEGER(11), primary_key=True, comment='id')
    contract_sublet_id = Column(String(100), nullable=False, server_default=text("''"), comment='uuid')
    sublet_config_type = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='转租类型:1委托转租2 租客自传')
    apply_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='申请时间')
    sublet_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='转租时间')
    service_charge = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='转租服务费')
    is_revoke = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否撤销 0 未撤销 1撤销')
    revoke_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='撤销时间')
    revoke_charge = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='撤销违约金')
    contract_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='合同id')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='状态是否删除; 1:正常, 2:删除')
    comment = Column(Text, nullable=False, comment='备注')
    sublet_config = Column(Text, nullable=False, comment='转租配置')
    sublet_bill_id = Column(String(100), nullable=False, server_default=text("''"), comment='转租应收id')
    revoke_bill_id = Column(String(100), nullable=False, server_default=text("''"), comment='转租退款id')
    is_sign = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否签约')
    fdd_id = Column(String(64), nullable=False, server_default=text("''"), comment='法大大ID')


class ContractTemplate(Base):
    __tablename__ = 'contract_template'

    contract_template_id = Column(INTEGER(11), primary_key=True)
    service_code = Column(String(100), nullable=False, server_default=text("''"), comment='业务CODE')
    template_name = Column(String(50), nullable=False, server_default=text("''"), comment='模板名称')
    source_file_name = Column(String(200), nullable=False, server_default=text("''"), comment='前端原文件名字')
    file_name = Column(String(200), nullable=False, server_default=text("''"), comment='生成后文件名字')
    file_name_directory = Column(String(200), nullable=False, server_default=text("''"), comment='生成后文件路径')
    contract_template_type_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='合同模板类型表')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class CostConfiguration(Base):
    __tablename__ = 'cost_configuration'

    cost_configuration_id = Column(INTEGER(11), primary_key=True)
    cost_name = Column(String(100), nullable=False, server_default=text("''"), comment='费用名称')
    revenue_type = Column(TINYINT(1), nullable=False, server_default=text("'3'"), comment='1：门店营收，2：平台营收，3：托管自营')
    is_system = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='0非系统1系统')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    remarks = Column(String(64), nullable=False, server_default=text("''"), comment='备注')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


t_cost_relationship = Table(
    'cost_relationship', metadata,
    Column('cost_configuration_id', INTEGER(10), nullable=False, comment='费用ID'),
    Column('cost_name', String(100), nullable=False, server_default=text("''"), comment='费用名称'),
    Column('cost_money', DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='费用金额'),
    Column('table_name', String(100), nullable=False, server_default=text("''"), comment='产生费用的表名称'),
    Column('table_id', INTEGER(11), nullable=False, server_default=text("'0'"), comment='产生费用的表ID'),
    Column('cost_type', TINYINT(1), nullable=False, server_default=text("'0'"), comment='费用类型(0:收入,1:支出)'),
    Column('revenue_type', TINYINT(1), nullable=False, server_default=text("'3'"), comment='1：门店营收，2：平台营收，3：托管自营'),
    Column('bill_id', INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='bill_id'),
    Column('operator_employee_id', INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人'),
    Column('create_time', INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间'),
    Column('update_time', INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间'),
    Column('is_delete', TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除'),
    Column('delete_time', INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间'),
    Column('company_id', INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID'),
    Index('table_id', 'table_id', 'table_name')
)


class Coupon(Base):
    __tablename__ = 'coupon'

    coupon_id = Column(INTEGER(11), primary_key=True)
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    room_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='房间id')
    contract_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='合同id')
    coupon_rule_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='优惠规则ID')
    cost_configuration_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='优惠科目ID')
    coupon_name = Column(String(200), nullable=False, comment='优惠券名称')
    coupon_number = Column(String(100), nullable=False, unique=True, comment='优惠码')
    coupon_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='优惠券金额')
    tenant_phone = Column(String(11), nullable=False, server_default=text("''"), comment='租客电话号码')
    finance_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='财务类型 1:无责优惠; 2:有责优惠;')
    is_use = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否被使用')
    coupon_source = Column(String(8), nullable=False, server_default=text("''"), comment='优惠券来源')
    is_recovery = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否已回收 0: 未回收; 1: 已回收')
    recovery_money = Column(INTEGER(1), nullable=False, server_default=text("'0'"), comment='回收金额')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class CouponRule(Base):
    __tablename__ = 'coupon_rule'

    coupon_rule_id = Column(INTEGER(11), primary_key=True)
    company_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='公司ID')
    coupon_rule_name = Column(String(16), nullable=False, server_default=text("''"), comment='优惠券规则名称')
    coupon_money = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='优惠券面值')
    coupon_quantity = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='优惠券数量')
    service_code = Column(String(200), nullable=False, server_default=text("''"), comment='业务Code全局唯一')
    finance_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='财务类型: 1: 无责优惠; 2: 有责优惠')
    indate_start = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='有效期开始')
    indate_end = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='有效期结束')
    is_invalid = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否已失效 0: 未失效; 1: 已失效')
    remarks = Column(Text, comment='使用说明')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class CouponRuleApartmentRelation(Base):
    __tablename__ = 'coupon_rule_apartment_relation'

    coupon_rule_apartment_relation_id = Column(INTEGER(11), primary_key=True)
    coupon_rule_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='规则ID')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    is_use = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否被使用')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class CouponRulePhoneRelation(Base):
    __tablename__ = 'coupon_rule_phone_relation'

    coupon_rule_tenant_relation_id = Column(INTEGER(11), primary_key=True)
    coupon_rule_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='规则ID')
    tenant_phone = Column(String(11), nullable=False, server_default=text("'0'"), comment='租客手机号')
    is_use = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否被使用')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class CupMember(Base):
    __tablename__ = 'cup_member'

    id = Column(INTEGER(11), primary_key=True, comment='主键')
    cup_member_id = Column(String(64), nullable=False, server_default=text("''"), comment='唯一id')
    commercial_name = Column(String(200), nullable=False, server_default=text("''"), comment='公司名称')
    id_name = Column(String(50), nullable=False, server_default=text("''"), comment='法人名称')
    id_no = Column(LargeBinary, nullable=False, comment='法人身份证')
    mobile_no = Column(LargeBinary, nullable=False, comment='电话号码')
    flag = Column(String(10), nullable=False, server_default=text("''"), comment='对公/对私 B 对公卡，C 对私卡')
    bank_name = Column(String(100), nullable=False, server_default=text("''"), comment='银行名称')
    branch_name = Column(String(100), nullable=False, server_default=text("''"), comment='支行名称')
    card_no = Column(LargeBinary, nullable=False, comment='银行账号')
    business_license = Column(String(100), nullable=False, server_default=text("''"), comment='营业执照编号')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    updat_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='状态1正常 0删除')
    gender = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='性别0默认值 1男 2女')


class Custom(Base):
    __tablename__ = 'custom'

    custom_id = Column(INTEGER(11), primary_key=True)
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    phone_md5 = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='电话号码MD5')
    phone = Column(LargeBinary, nullable=False, comment='电话号码')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class CustomDetailed(Base):
    __tablename__ = 'custom_detailed'

    custom_detailed_id = Column(INTEGER(11), primary_key=True)
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    custom_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='客户ID')
    phone_md5 = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='电话号码MD5')
    phone = Column(LargeBinary, nullable=False, comment='电话号码')
    name = Column(String(20), nullable=False, server_default=text("''"), comment='客户姓名')
    gender = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='性别')
    office_address = Column(String(255), nullable=False, server_default=text("''"), comment='办公地址')
    custom_source = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='客户来源')
    order = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='排序')
    last_custom_follow_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='最后跟进ID')
    hope_apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='意向门店ID')
    employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='客户添加人')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class CustomFollow(Base):
    __tablename__ = 'custom_follow'

    custom_follow_id = Column(INTEGER(11), primary_key=True)
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    custom_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='客户ID')
    custom_detailed_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='客户详细ID')
    custom_follow_configuration_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='跟进状态')
    content = Column(Text, comment='跟进内容')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class CustomFollowConfiguration(Base):
    __tablename__ = 'custom_follow_configuration'

    custom_follow_configuration_id = Column(INTEGER(11), primary_key=True)
    name = Column(String(255), nullable=False, server_default=text("''"), comment='客户跟进状态名')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class Customer(Base):
    __tablename__ = 'customer'

    customer_id = Column(INTEGER(11), primary_key=True)
    company_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='公司ID')
    customer_name = Column(String(30), nullable=False, server_default=text("''"), comment='客户姓名')
    customer_education = Column(String(30), nullable=False, server_default=text("''"), comment='客户学历 1:高中及以下 2:大专 3:本科 4:硕士 5:博士及以上')
    customer_occupation = Column(String(50), nullable=False, server_default=text("''"), comment='客户职业')
    customer_birthday = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='客户生日')
    customer_gender = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='性别（1男,2女）')
    customer_idcard_md5 = Column(String(32), nullable=False, index=True, server_default=text("''"), comment='客户证件号MD5')
    customer_idcard = Column(LargeBinary, nullable=False, comment='客户证件号')
    customer_idcard_type = Column(String(5), nullable=False, server_default=text("''"), comment='客户证件号类型')
    customer_phone_md5 = Column(String(32), nullable=False, index=True, server_default=text("''"), comment='客户手机号MD5')
    customer_phone = Column(LargeBinary, nullable=False, comment='客户手机号码密文')
    customer_email = Column(String(50), nullable=False, server_default=text("''"), comment='客户邮箱')
    customer_source_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='客户来源(sales_sources_id)')
    customer_address = Column(String(255), nullable=False, server_default=text("''"), comment='客户地址')
    customer_city_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='城市ID')
    company_name = Column(String(50), nullable=False, server_default=text("''"), comment='工作单位')
    company_contact = Column(String(30), nullable=False, server_default=text("''"), comment='单位联系人')
    company_contract_phone_md5 = Column(String(32), nullable=False, server_default=text("''"), comment='单位联系人电话MD5')
    company_contract_phone = Column(LargeBinary, nullable=False, comment='单位联系人电话')
    customer_emergency_contact = Column(String(255), nullable=False, server_default=text("''"), comment='客户紧急联系人')
    customer_emergency_phone_md5 = Column(String(32), nullable=False, server_default=text("''"), comment='客户紧急联系人电话MD5')
    customer_emergency_phone = Column(LargeBinary, nullable=False, comment='客户紧急联系人电话')
    customer_emergency_configuration_id = Column(LargeBinary, nullable=False, comment='客户紧急联系人关系（interpersonal_relation_configuration_id）')
    remarks = Column(String(100), nullable=False, server_default=text("''"), comment='备注')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class CustomerComplaintWorkOrderCategory(Base):
    __tablename__ = 'customer_complaint_work_order_category'
    __table_args__ = (
        Index('fx_complaint_work_detail_id', 'work_detail_id', 'complaint_work_type_id', 'complaint_work_classify_id'),
    )

    work_order_category_id = Column(INTEGER(11), primary_key=True, comment='ID')
    work_detail_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='工单详情内容ID')
    complaint_work_type_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='客诉工单类型ID')
    complaint_work_classify_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='问题分类ID')
    complaint_work_classify_app_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='工单问题二级APP分类ID')
    complaint_work_subclassify_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='问题子分类ID')
    complaint_work_subclassify_app_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='工单问题子分类APP分类ID')
    complaint_work_type_final_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='工单问题分类')
    complaint_work_classify_final_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='工单问题分类')
    complaint_work_subclassify_final_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='工单问题子分类')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class CustomerComplaintWorkOrderClassify(Base):
    __tablename__ = 'customer_complaint_work_order_classify'

    complaint_work_classify_id = Column(INTEGER(11), primary_key=True, comment='ID')
    complaint_work_type_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='客诉工单类型ID')
    complaint_work_classify_name = Column(String(150), nullable=False, server_default=text("''"), comment='客诉工单分类名称')
    complaint_work_classify_display = Column(String(255), nullable=False, server_default=text("''"))
    additional_item = Column(String(255), nullable=False, server_default=text("''"), comment='附加项')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    complaint_work_classify_describe = Column(String(150), nullable=False, server_default=text("''"), comment='客诉工单分类描述')


class CustomerComplaintWorkOrderClassifyApp(Base):
    __tablename__ = 'customer_complaint_work_order_classify_app'

    complaint_work_classify_app_id = Column(INTEGER(11), primary_key=True, comment='ID')
    complaint_work_type_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='客诉工单类型ID')
    complaint_work_classify_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='客诉工单二级分类ID')
    complaint_work_classify_display = Column(String(150), nullable=False, server_default=text("''"), comment='客诉工单二级分类显示名称')
    additional_item = Column(String(32), nullable=False, server_default=text("''"), comment='附加显示项')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    complaint_work_classify_describe = Column(String(150), nullable=False, server_default=text("''"), comment='客诉工单分类描述')


class CustomerComplaintWorkOrderSubclassify(Base):
    __tablename__ = 'customer_complaint_work_order_subclassify'

    complaint_work_subclassify_id = Column(INTEGER(11), primary_key=True, comment='ID')
    complaint_work_classify_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='客诉工单分类ID')
    complaint_work_subclassify_name = Column(String(150), nullable=False, server_default=text("''"), comment='客诉工单子分类名称')
    complaint_work_subclassify_case = Column(String(400), nullable=False, server_default=text("''"), comment='解决方案')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class CustomerComplaintWorkOrderSubclassifyApp(Base):
    __tablename__ = 'customer_complaint_work_order_subclassify_app'

    complaint_work_subclassify_app_id = Column(INTEGER(11), primary_key=True, comment='ID')
    complaint_work_classify_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='客诉工单二级分类ID')
    complaint_work_classify_app_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='客诉工单二级app分类ID')
    complaint_work_subclassify_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='客诉工单三级子分类ID')
    complaint_work_subclassify_display = Column(String(150), nullable=False, server_default=text("''"), comment='客诉工单三级分类显示名称')
    complaint_work_subclassify_case = Column(String(400), nullable=False, server_default=text("''"), comment='解决方案')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class CustomerComplaintWorkOrderType(Base):
    __tablename__ = 'customer_complaint_work_order_type'
    __table_args__ = (
        Index('complaint_work_type_id', 'complaint_work_type_id', 'work_order_type_id'),
    )

    complaint_work_type_id = Column(INTEGER(11), primary_key=True, comment='ID')
    complaint_work_type_name = Column(String(50), nullable=False, server_default=text("''"), comment='客诉工单类型名称')
    work_order_type_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='工单类型')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class CustomerRefuseReason(Base):
    __tablename__ = 'customer_refuse_reason'

    refuse_reason_id = Column(INTEGER(11), primary_key=True)
    reson_type = Column(TINYINT(1), nullable=False, index=True, server_default=text("'0'"), comment='原因类型：1:价格原因 2:人员原因 3:距离原因 4:硬件设施问题 5:周围环境问题')
    reson_val = Column(String(30), nullable=False, server_default=text("''"), comment='原因值')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class CustomerRoomPassword(Base):
    __tablename__ = 'customer_room_password'

    customer_room_id = Column(String(32), primary_key=True, comment='看房主键')
    customer_with_id = Column(INTEGER(11), nullable=False, index=True, comment='带看单ID')
    room_password = Column(String(25), comment='看房密码')
    start_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='开始时间')
    end_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='结束时间')
    delete_status = Column(TINYINT(4), server_default=text("'0'"), comment='删除状态(1:未删除,2:已删除)')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    create_time = Column(INTEGER(11), server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), server_default=text("'0'"), comment='修改时间')


class CustomerRoomRecord(Base):
    __tablename__ = 'customer_room_record'

    customer_room_record_id = Column(String(32), primary_key=True, comment='看房记录主键')
    customer_room_id = Column(String(32), nullable=False, index=True, comment='看房ID')
    room_name = Column(String(25), comment='房间名称')
    room_id = Column(String(32), comment='房间ID')
    delete_status = Column(TINYINT(4), server_default=text("'0'"), comment='删除状态(1:未删除,2:已删除)')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    create_time = Column(INTEGER(11), server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), server_default=text("'0'"), comment='修改时间')


class CustomerWith(Base):
    __tablename__ = 'customer_with'

    customer_with_id = Column(INTEGER(11), primary_key=True)
    customer_with_number = Column(String(30), nullable=False, server_default=text("''"), comment='带看单编号')
    table_name = Column(String(64), nullable=False, server_default=text("''"), comment='来源表名')
    table_id = Column(INTEGER(10), nullable=False, comment='来源table_id')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    customer_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='客户ID')
    apartment_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='意向门店ID')
    intention_theme = Column(TINYINT(2), nullable=False, server_default=text("'0'"), comment='意向主题(room_color_configuration_id)')
    checkin_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='计划入住时间')
    intention_price = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='预期看房价格(分)')
    live_number = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='居住人数')
    booking_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='预约看房日期')
    time_range = Column(String(100), nullable=False, server_default=text("''"), comment='预约看房时间段')
    status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='状态（custom_follow_configuration）')
    refuse_reason = Column(String(50), nullable=False, server_default=text("''"), comment='拒绝原因')
    source_from = Column(TINYINT(1), nullable=False, server_default=text("'3'"), comment='来源: 1: 官网 2: M站 3: APP 4:call_center')
    ueto_employee_id = Column(String(32), nullable=False, server_default=text("''"), comment='上户')
    with_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='带户')
    remarks = Column(MEDIUMTEXT, nullable=False, comment='备注')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"))
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class CustomerWithLog(Base):
    __tablename__ = 'customer_with_log'

    customer_with_log_id = Column(INTEGER(11), primary_key=True)
    customer_with_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='带看单ID')
    befor_apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='意向门店ID（转店前）')
    after_apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='意向门店ID（转店后）')
    before_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='改变前状态')
    after_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='改变后状态')
    before_with_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='带看单状态 1:未带看 2:接受（已带看）')
    after_with_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='带看单状态 1:未带看 2:接受（已带看）')
    before_ueto_employee_id = Column(String(32), nullable=False, server_default=text("'0'"), comment='上户(变化前)')
    after_ueto_employee_id = Column(String(32), nullable=False, server_default=text("'0'"), comment='上户(变化后)')
    before_with_employee_id = Column(INTEGER(11), nullable=False, comment='带户(变化前)')
    after_with_employee_id = Column(INTEGER(11), nullable=False, comment='带户(变化后)')
    log_content = Column(MEDIUMTEXT, nullable=False, comment='日志内容')
    log_type = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='带看单状态 1:新增 2:变更')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"))
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    before_live_number = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='居住人数(变化前)')
    after_live_number = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='居住人数(变化后)')
    before_checkin_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='计划入住时间(变化前)')
    after_checkin_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment=' 计划入住时间(变化后)')
    before_intention_price = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='预期看房价格(分)(变化前)')
    after_intention_price = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='预期看房价格(分)(变化后)')
    before_booking_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='预约看房日期 (变化前)')
    after_booking_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='预约看房日期 (变化后)')
    before_time_range = Column(String(100), nullable=False, server_default=text("''"), comment='预约看房时间段 (变化前)')
    after_time_range = Column(String(100), nullable=False, server_default=text("''"), comment='预约看房时间段 (变化后)')
    remarks = Column(MEDIUMTEXT, nullable=False, comment='备注')


class CustomerWithLogBat(Base):
    __tablename__ = 'customer_with_log_bat'

    customer_with_log_id = Column(INTEGER(11), primary_key=True)
    customer_with_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='带看单ID')
    befor_apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='意向门店ID（转店前）')
    after_apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='意向门店ID（转店后）')
    before_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='改变前状态')
    after_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='改变后状态')
    before_with_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='带看单状态 1:未带看 2:接受（已带看）')
    after_with_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='带看单状态 1:未带看 2:接受（已带看）')
    before_ueto_employee_id = Column(String(32), nullable=False, server_default=text("'0'"), comment='上户(变化前)')
    after_ueto_employee_id = Column(String(32), nullable=False, server_default=text("'0'"), comment='上户(变化后)')
    before_with_employee_id = Column(INTEGER(11), nullable=False, comment='带户(变化前)')
    after_with_employee_id = Column(INTEGER(11), nullable=False, comment='带户(变化后)')
    log_content = Column(MEDIUMTEXT, nullable=False, comment='日志内容')
    log_type = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='带看单状态 1:新增 2:变更')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"))
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    before_live_number = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='居住人数(变化前)')
    after_live_number = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='居住人数(变化后)')
    before_checkin_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='计划入住时间(变化前)')
    after_checkin_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment=' 计划入住时间(变化后)')
    before_intention_price = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='预期看房价格(分)(变化前)')
    after_intention_price = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='预期看房价格(分)(变化后)')
    before_booking_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='预约看房日期 (变化前)')
    after_booking_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='预约看房日期 (变化后)')
    before_time_range = Column(String(100), nullable=False, server_default=text("''"), comment='预约看房时间段 (变化前)')
    after_time_range = Column(String(100), nullable=False, server_default=text("''"), comment='预约看房时间段 (变化后)')
    remarks = Column(MEDIUMTEXT, nullable=False, comment='备注')


class CustomerWithLogCleanBak(Base):
    __tablename__ = 'customer_with_log_clean_bak'

    customer_with_log_id = Column(INTEGER(11), primary_key=True)
    customer_with_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='带看单ID')
    befor_apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='意向门店ID（转店前）')
    after_apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='意向门店ID（转店后）')
    before_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='改变前状态')
    after_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='改变后状态')
    before_with_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='带看单状态 1:未带看 2:接受（已带看）')
    after_with_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='带看单状态 1:未带看 2:接受（已带看）')
    before_ueto_employee_id = Column(VARCHAR(32), nullable=False, server_default=text("'0'"), comment='上户(变化前)')
    after_ueto_employee_id = Column(VARCHAR(32), nullable=False, server_default=text("'0'"), comment='上户(变化后)')
    before_with_employee_id = Column(INTEGER(11), nullable=False, comment='带户(变化前)')
    after_with_employee_id = Column(INTEGER(11), nullable=False, comment='带户(变化后)')
    log_content = Column(MEDIUMTEXT, nullable=False, comment='日志内容')
    log_type = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='带看单状态 1:新增 2:变更')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"))
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    before_live_number = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='居住人数(变化前)')
    after_live_number = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='居住人数(变化后)')
    before_checkin_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='计划入住时间(变化前)')
    after_checkin_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment=' 计划入住时间(变化后)')
    before_intention_price = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='预期看房价格(分)(变化前)')
    after_intention_price = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='预期看房价格(分)(变化后)')
    before_booking_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='预约看房日期 (变化前)')
    after_booking_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='预约看房日期 (变化后)')
    before_time_range = Column(VARCHAR(100), nullable=False, server_default=text("''"), comment='预约看房时间段 (变化前)')
    after_time_range = Column(VARCHAR(100), nullable=False, server_default=text("''"), comment='预约看房时间段 (变化后)')
    remarks = Column(MEDIUMTEXT, nullable=False, comment='备注')


class DailyContractConfig(Base):
    __tablename__ = 'daily_contract_config'

    contract_config_id = Column(String(32), primary_key=True, server_default=text("''"), comment='合同押付方案主键')
    deposit_rent_type_id = Column(String(32), nullable=False, comment='合同押金租金支付方式id')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class DailyContractConfigSchemeRelation(Base):
    __tablename__ = 'daily_contract_config_scheme_relation'

    daily_contract_config_scheme_relation_id = Column(String(32), primary_key=True, server_default=text("''"), comment='合同押付方案门店关系主键')
    daily_contract_scheme_id = Column(String(32), nullable=False, index=True, server_default=text("''"), comment='合同方案主键')
    daily_contract_config_id = Column(String(32), nullable=False, index=True, comment='合同押付方式主键')
    apartment_id = Column(String(32), nullable=False, index=True, server_default=text("'0'"), comment='门店主键')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class DailyContractDepositRentType(Base):
    __tablename__ = 'daily_contract_deposit_rent_type'

    deposit_rent_type_id = Column(String(32), primary_key=True, comment='押金租金支付方式id')
    deposit_type_name = Column(String(32), nullable=False, server_default=text("''"), comment='押金方式')
    rent_type_name = Column(String(32), nullable=False, server_default=text("''"), comment='租金支付方式')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"))
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"))
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"))
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"))


class DailyContractPeriod(Base):
    __tablename__ = 'daily_contract_period'

    daily_contract_period_id = Column(String(32), primary_key=True, comment='合同周期主键')
    period_end = Column(TINYINT(3), nullable=False, server_default=text("'5'"), comment='周期数 结束天数')
    period_begin = Column(TINYINT(3), nullable=False, server_default=text("'1'"), comment='周期数 开始天数')
    discount_scale = Column(DECIMAL(10, 2), nullable=False, server_default=text("'1.00'"), comment='租金系数 默认为 1')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class DailyContractPeriodSchemeRelation(Base):
    __tablename__ = 'daily_contract_period_scheme_relation'

    daily_contract_period_scheme_relation_id = Column(String(32), primary_key=True, server_default=text("''"), comment='合同周期门店关系表')
    daily_contract_scheme_id = Column(String(32), nullable=False, index=True, server_default=text("''"), comment='合同方案主键')
    daily_contract_period_id = Column(String(32), nullable=False, index=True, server_default=text("''"), comment='合同周期主键')
    apartment_id = Column(String(32), nullable=False, index=True, server_default=text("'0'"), comment='门店主键')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


t_daily_contract_rent_config = Table(
    'daily_contract_rent_config', metadata,
    Column('daily_contract_rent_config_id', String(32), nullable=False, server_default=text("''"), comment='主键'),
    Column('delete_status', TINYINT(1), nullable=False, server_default=text("'1'"), comment='删除状态'),
    Column('create_time', INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间'),
    Column('update_time', INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间'),
    Column('delete_time', INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间'),
    Column('period_end', TINYINT(3), nullable=False, server_default=text("'5'"), comment='周期数 结束天数'),
    Column('period_begin', TINYINT(3), nullable=False, server_default=text("'1'"), comment='周期数 开始天数'),
    Column('apartment_id', INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店主键'),
    Column('company_id', INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司主键'),
    Column('discount_scale', DECIMAL(10, 2), nullable=False, comment='租金系数')
)


class DailyContractScheme(Base):
    __tablename__ = 'daily_contract_scheme'

    scheme_id = Column(String(32), primary_key=True, server_default=text("''"), comment='方案主键')
    scheme_name = Column(String(255), nullable=False, server_default=text("''"), comment='方案名称')
    is_system = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否系统默认')
    operator_employee_id = Column(String(32), nullable=False, server_default=text("'0'"), comment='操作人id')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='删除状态')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    scheme_type_id = Column(String(32), nullable=False, comment='合同方案使用场景id')


class DailyContractSchemeType(Base):
    __tablename__ = 'daily_contract_scheme_type'

    scheme_type_id = Column(String(32), primary_key=True, comment='使用场景id')
    scheme_type_name = Column(String(32), nullable=False, comment='使用场景')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"))
    create_time = Column(INTEGER(11), server_default=text("'0'"))
    update_time = Column(INTEGER(11), server_default=text("'0'"))
    delete_time = Column(INTEGER(11), server_default=text("'0'"))


class DailyPaper(Base):
    __tablename__ = 'daily_paper'

    daily_paper_id = Column(INTEGER(11), primary_key=True, comment='日报id')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    day_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='日报时间')
    new_room_count = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新房量')
    new_room_in_live = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新房在住量')
    new_room_empt = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新房空置量')
    new_room_average_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='新房平均房价')
    old_room_count = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='老房量')
    old_room_in_live = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='老房在住量')
    old_room_empt = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='老房空置量')
    old_room_average_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='老房平均房价')
    construction_room_count = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='施工房量')
    construction_room_intention_count = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='施工房意向金数')
    construction_room_preordain_count = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='施工房定金数')
    maintain_room_count = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='维修房统计')
    construction_room_d_n_m = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='施工房本月交房数')
    other_room = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='其他用房')
    all_room_count = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='门店全部房间')
    handsel_preordain_count = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='预定排放总数')
    today_custom = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='今日上户量')
    today_rent = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='今日直接签约数')
    today_intention_count = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='今日意向金数')
    today_preordain_count = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='今日定金数')
    today_reservation_surrender = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='今日预退数')
    today_contract_count = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='今日合同数')
    today_is_preordain_count = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='预定数')
    today_surrender = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='今日退房数')
    reservation_surrender_count = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='预退数')
    today_bill_count = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='今日开票据总量')
    grand_tota_intention = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='累计意向金数')
    grand_tota_preordain = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='累计定金数')
    long_rent_count = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='长租数量')
    short_rent_count = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='短租数量')
    night_rent_rate = Column(Float, nullable=False, server_default=text("'0'"), comment='间夜出租率')
    cashier_swiping_card = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='收银刷卡')
    cashier_money = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='收银现金')
    cashier_losses_money = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='收银挂账')
    privilege = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='优惠')
    cashier_other = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='其他收银')
    receivables_rent = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='应收房租数')
    lehui_money = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='乐惠')
    proceeds_rent = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='实收房租数')
    check_out_expenditure = Column(DECIMAL(10, 3), nullable=False, server_default=text("'0.000'"), comment='退房支出')
    pretty_cash_expenditure = Column(DECIMAL(10, 3), nullable=False, server_default=text("'0.000'"), comment='备用金支出')
    uncollected_remark = Column(String(255), nullable=False, server_default=text("''"), comment='未收情况')
    other_remark = Column(String(255), nullable=False, server_default=text("''"), comment='其他情况')
    contract_count = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='有效合同数')
    contract_ious_count = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='有效合同数')
    stay_room_count = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='待租房')
    all_room_is_rent = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='全部在租房间')
    all_contract_rent_money = Column(DECIMAL(11, 2), nullable=False, server_default=text("'0.00'"), comment='全部在租合同租金')
    avg_rent = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='平均房价')
    avg_rent_service_fee = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='平均服务费')
    can_sale = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='可售房量')
    online = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='上线房量')
    disable = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='停用房')
    old_contract = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='老合同')
    is_preordain_rate = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='招租率')
    rental_rate = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='入住率')
    vacancy_rate = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='空置率')
    contract_renewal_rate = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='续约率')
    average_house_price = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='平均房价')
    default_rate = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='违约率')
    today_sales_volume = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='今日销量')
    contract_trading_number = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='今日合同')
    conversion_rate = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='今日转化率')
    preordain_trading_number = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='今日定金')
    today_rent_increase = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='今日净增长')


class Demand(Base):
    __tablename__ = 'demand'

    demand_id = Column(INTEGER(11), primary_key=True)
    title = Column(String(255), nullable=False, server_default=text("''"), comment='需求标题')
    describe = Column(Text, nullable=False, comment='需求描述')
    attachment_url = Column(String(255), nullable=False, server_default=text("''"), comment='附件地址')
    attachment_name = Column(String(255), nullable=False, server_default=text("''"), comment='附件名')
    group_name = Column(String(255), nullable=False, server_default=text("''"), comment='部门')
    employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='提交人')
    email = Column(String(100), nullable=False, server_default=text("''"), comment='邮箱地址')
    status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='状态 0：未受理，1：已受理，2：已拒绝，3：已转入')
    type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='需求类型 1功能改进 2用户体验 3功能BUG')
    follow_title = Column(String(255), nullable=False, server_default=text("''"), comment='跟进标题')
    follow_describe = Column(Text, nullable=False, comment='跟进后需求描述')
    refuse_reason = Column(String(255), nullable=False, server_default=text("''"), comment='拒绝原因')
    head_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='跟进人')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class DemandFollow(Base):
    __tablename__ = 'demand_follow'

    demand_follow_id = Column(INTEGER(11), primary_key=True)
    demand_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='需求id')
    content = Column(String(255), nullable=False, server_default=text("''"), comment='跟进情况')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='跟进员工id')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class DemandQuestion(Base):
    __tablename__ = 'demand_question'

    demand_question_id = Column(INTEGER(11), primary_key=True)
    question_name = Column(String(100), nullable=False, server_default=text("''"), comment='问题名称')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class DemandVote(Base):
    __tablename__ = 'demand_vote'

    demand_vote_id = Column(INTEGER(11), primary_key=True)
    demand_vote_batch_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='需求批次表id')
    demand_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='需求id')
    score_info = Column(String(255), nullable=False, server_default=text("''"), comment='得分记录json')
    vote_name = Column(String(100), nullable=False, server_default=text("''"), comment='投票人姓名')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class DemandVoteBatch(Base):
    __tablename__ = 'demand_vote_batch'

    demand_vote_batch_id = Column(INTEGER(11), primary_key=True)
    demand_ids = Column(String(255), nullable=False, server_default=text("''"), comment='需求id集合,逗号分隔开')
    status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='状态 0停止 1 投票中')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class DingTalkApplyLog(Base):
    __tablename__ = 'ding_talk_apply_log'

    id = Column(INTEGER(11), primary_key=True)
    apply_id = Column(String(120), comment='审批id')
    delete_status = Column(INTEGER(255), server_default=text("'1'"))
    create_time = Column(INTEGER(11))
    update_time = Column(INTEGER(11))
    delete_time = Column(INTEGER(11))
    apply_ret = Column(INTEGER(1), server_default=text("'1'"), comment='1. 审批中，2.同意，3 . 拒绝。')
    bill_id = Column(String(64), comment='账单id')
    employee_id = Column(INTEGER(11), comment='申请人')
    days = Column(INTEGER(11), comment='删除天数')
    end_time = Column(INTEGER(11), comment='删除截止日')
    remark = Column(String(512), server_default=text("''"), comment='备注')


class DingTalkAuditingContentLog(Base):
    __tablename__ = 'ding_talk_auditing_content_log'

    id = Column(String(32), primary_key=True, comment='主键id')
    apply_id = Column(String(120), unique=True, comment='审批id')
    content = Column(String(3000), server_default=text("''"), comment='审批过程内容信息')
    delete_status = Column(INTEGER(1), server_default=text("'1'"), comment='删除状态 1=未删除 2=已删除')
    delete_time = Column(INTEGER(11), comment='删除时间')
    create_time = Column(INTEGER(11), comment='创建时间')
    update_time = Column(INTEGER(11), comment='更新时间')


class DingTalkAuditingLog(Base):
    __tablename__ = 'ding_talk_auditing_log'

    id = Column(String(32), primary_key=True, comment='主键id')
    apply_id = Column(String(120), comment='审批id')
    config_id = Column(String(32), comment='配置id')
    template_type = Column(String(50), comment='审批类型')
    employee_id = Column(INTEGER(11), comment='申请人id')
    examine_employee_id = Column(INTEGER(11), comment='当前审批人id')
    pre_examine_employee_id = Column(INTEGER(11), comment='上一个审批人id')
    callback_url = Column(String(100), comment='回调url')
    callback_param = Column(String(200), comment='回调参数')
    apply_ret = Column(INTEGER(1), server_default=text("'1'"), comment='审批状态1. 审批中，2.同意，3 . 拒绝。')
    remark = Column(String(1024), server_default=text("''"), comment='日志内容备注')
    delete_status = Column(INTEGER(1), server_default=text("'1'"), comment='删除状态 1=未删除 2=已删除')
    delete_time = Column(INTEGER(11), comment='删除时间')
    create_time = Column(INTEGER(11), comment='创建时间')
    update_time = Column(INTEGER(11), comment='更新时间')


class DingTalkConfig(Base):
    __tablename__ = 'ding_talk_config'

    id = Column(INTEGER(11), primary_key=True)
    config_id = Column(INTEGER(11), comment='配置id')
    city_id = Column(INTEGER(11), server_default=text("'0'"))
    city_name = Column(String(32), server_default=text("''"))
    bill_type = Column(INTEGER(1), comment='账单类型1 合同，2 乐乎分期，3 门店')
    delete_status = Column(INTEGER(1), server_default=text("'1'"))
    delete_time = Column(INTEGER(11), server_default=text("'0'"))
    create_time = Column(INTEGER(11), server_default=text("'0'"))
    update_time = Column(INTEGER(11), server_default=text("'0'"))
    operator_id = Column(String(11), server_default=text("''"), comment='操作人id')


class DingTalkConfigEmployee(Base):
    __tablename__ = 'ding_talk_config_employee'

    id = Column(INTEGER(11), primary_key=True, comment='主键')
    ding_talk_config_id = Column(INTEGER(11), comment='配置id')
    ding_talk_id = Column(String(64), comment='钉钉id')
    employee_id = Column(INTEGER(11), comment='员工id')
    type = Column(INTEGER(1), server_default=text("'1'"), comment='员工类型 1：抄送，2：审批')
    level = Column(INTEGER(11), server_default=text("'0'"), comment='审批层级')
    name = Column(String(32), nullable=False, server_default=text("''"), comment='员工名')
    delete_status = Column(INTEGER(1), server_default=text("'1'"))
    delete_time = Column(INTEGER(11), server_default=text("'0'"))
    create_time = Column(INTEGER(11), server_default=text("'0'"))
    update_time = Column(INTEGER(11), server_default=text("'0'"))


class DingTalkTemplate(Base):
    __tablename__ = 'ding_talk_template'

    id = Column(INTEGER(11), primary_key=True, comment='主键')
    config_id = Column(String(32), nullable=False, comment='配置id')
    template_type = Column(String(50), nullable=False, comment='审批配置模板类型')
    name = Column(String(1024), nullable=False, comment='配置名称')
    city_id = Column(String(1024), comment='城市id  缓存用')
    operator_id = Column(INTEGER(11), comment='操作人id')
    delete_status = Column(INTEGER(1), nullable=False, server_default=text("'1'"), comment='删除状态 1=未删除 2=已删除')
    delete_time = Column(INTEGER(11), server_default=text("'0'"), comment='删除时间')
    create_time = Column(INTEGER(11), server_default=text("'0'"))
    update_time = Column(INTEGER(11), server_default=text("'0'"))


class DingTalkTemplateApartmentRelation(Base):
    __tablename__ = 'ding_talk_template_apartment_relation'

    id = Column(String(32), primary_key=True, comment='主键')
    config_id = Column(String(32), comment='钉钉id')
    apartment_id = Column(INTEGER(9), nullable=False, comment='配置id')
    city_id = Column(INTEGER(9), server_default=text("'0'"), comment='城市id')
    city_name = Column(String(32), server_default=text("''"), comment='城市名称')
    delete_status = Column(INTEGER(1), server_default=text("'1'"), comment='删除状态 1=未删除 2=已删除')
    delete_time = Column(INTEGER(11), server_default=text("'0'"))
    create_time = Column(INTEGER(11), server_default=text("'0'"))
    update_time = Column(INTEGER(11), server_default=text("'0'"))


class DingTalkTemplateApartmentRelationCopy(Base):
    __tablename__ = 'ding_talk_template_apartment_relation_copy'

    id = Column(String(32), primary_key=True, comment='主键')
    config_id = Column(String(32), comment='钉钉id')
    apartment_id = Column(INTEGER(9), nullable=False, comment='配置id')
    city_id = Column(INTEGER(9), server_default=text("'0'"), comment='城市id')
    city_name = Column(String(32), server_default=text("''"), comment='城市名称')
    delete_status = Column(INTEGER(1), server_default=text("'1'"), comment='删除状态 1=未删除 2=已删除')
    delete_time = Column(INTEGER(11), server_default=text("'0'"))
    create_time = Column(INTEGER(11), server_default=text("'0'"))
    update_time = Column(INTEGER(11), server_default=text("'0'"))


class DingTalkTemplateCopy(Base):
    __tablename__ = 'ding_talk_template_copy'

    id = Column(INTEGER(11), primary_key=True, comment='主键')
    config_id = Column(String(32), nullable=False, comment='配置id')
    template_type = Column(String(50), nullable=False, comment='审批配置模板类型')
    name = Column(String(1024), nullable=False, comment='配置名称')
    city_id = Column(String(1024), comment='城市id  缓存用')
    operator_id = Column(INTEGER(11), comment='操作人id')
    delete_status = Column(INTEGER(1), nullable=False, server_default=text("'1'"), comment='删除状态 1=未删除 2=已删除')
    delete_time = Column(INTEGER(11), server_default=text("'0'"), comment='删除时间')
    create_time = Column(INTEGER(11), server_default=text("'0'"))
    update_time = Column(INTEGER(11), server_default=text("'0'"))


class DingTalkTemplateEmployeeRelation(Base):
    __tablename__ = 'ding_talk_template_employee_relation'

    id = Column(String(32), primary_key=True, comment='主键')
    config_id = Column(String(32), comment='配置id')
    ding_talk_id = Column(String(64), comment='钉钉id')
    employee_id = Column(INTEGER(11), comment='员工id')
    employee_name = Column(String(32), server_default=text("''"), comment='员工名')
    employee_type = Column(INTEGER(1), server_default=text("'1'"), comment='审批人类型 1：抄送，2：审批')
    level = Column(INTEGER(1), server_default=text("'0'"), comment='审批层级')
    delete_status = Column(INTEGER(1), server_default=text("'1'"), comment='删除状态 1=未删除 2=已删除')
    delete_time = Column(INTEGER(11), server_default=text("'0'"))
    create_time = Column(INTEGER(11), server_default=text("'0'"))
    update_time = Column(INTEGER(11), server_default=text("'0'"))


class DingTalkTemplateLog(Base):
    __tablename__ = 'ding_talk_template_log'

    id = Column(String(32), primary_key=True, comment='主键id')
    config_id = Column(String(32), comment='配置id')
    pre_content = Column(String(5000), comment='修改前的内容')
    operator_id = Column(INTEGER(11), comment='操作人id')
    delete_status = Column(INTEGER(1), server_default=text("'1'"), comment='删除状态 1=未删除 2=已删除')
    delete_time = Column(INTEGER(11), server_default=text("'0'"))
    create_time = Column(INTEGER(11), server_default=text("'0'"))
    update_time = Column(INTEGER(11), server_default=text("'0'"), comment='更新时间')


class DingTalkTemplateType(Base):
    __tablename__ = 'ding_talk_template_type'

    template_type = Column(String(50), primary_key=True, comment='模板类型')
    process_code = Column(String(100), unique=True, comment='审批模板唯一标识')
    template_type_name = Column(String(50), unique=True, comment='模板类型名称')


class DingxinCharging(Base):
    __tablename__ = 'dingxin_charging'

    id = Column(INTEGER(11), primary_key=True)
    dingxin_charging_id = Column(String(60), nullable=False, server_default=text("''"), comment='uuid')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店id')
    amount = Column(DECIMAL(11, 2), nullable=False, server_default=text("'0.00'"), comment='多少钱1吨 1度')
    equipment_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='设备类型1.电表2.冷水表3.热水表')
    delete_status = Column(TINYINT(1), nullable=False, comment='1正常')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class DingxinIntelligenceEquipment(Base):
    __tablename__ = 'dingxin_intelligence_equipment'

    id = Column(INTEGER(11), primary_key=True)
    dingxin_intelligence_equipment_id = Column(String(32), nullable=False, server_default=text("''"), comment='鼎信智能设备ID')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    room_number = Column(String(32), nullable=False, server_default=text("'0'"), comment='房间编号')
    room_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='房间ID')
    user_number = Column(String(32), nullable=False, server_default=text("'0'"), comment='用户号')
    postal_address = Column(String(64), nullable=False, server_default=text("'0'"), comment='通信地址')
    terminal_postal_address = Column(String(64), nullable=False, server_default=text("'0'"), comment='终端通信地址')
    equipment_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='设备类型1.电表2.冷水表3.热水表')
    money = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='电表余额')
    measure = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='电表起始度数 水表起始吨数')
    use_measure = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='已使用多少')
    switch = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='设备状态1.开0.关')
    start_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='1待初始化 0不需要初始化')
    switch_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作开关时间')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    delete_status = Column(INTEGER(11), nullable=False, server_default=text("'1'"), comment='是否删除1否2是')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class DingxinIntelligenceEquipmentMoney(Base):
    __tablename__ = 'dingxin_intelligence_equipment_money'

    id = Column(INTEGER(11), primary_key=True)
    dingxin_intelligence_equipment_money_id = Column(String(32), nullable=False, server_default=text("''"), comment='uuid')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    room_number = Column(String(32), nullable=False, server_default=text("'0'"), comment='房间编号')
    room_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='房间ID')
    am_money = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='电表余额')
    water_money = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='水表余额')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    delete_status = Column(INTEGER(11), nullable=False, server_default=text("'1'"), comment='是否删除1否2是')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class DingxinIntelligenceEquipmentReading(Base):
    __tablename__ = 'dingxin_intelligence_equipment_reading'

    id = Column(INTEGER(11), primary_key=True)
    dingxin_intelligence_equipment_reading_id = Column(String(32), nullable=False, server_default=text("''"), comment='鼎信智能设备读数ID')
    dingxin_intelligence_equipment_id = Column(String(32), nullable=False, server_default=text("''"), comment='设备ID')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    measure = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='底度')
    day_measure = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='每日用量')
    day_amount = Column(DECIMAL(10, 2), nullable=False, comment='每日消费')
    use_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='使用时间')


class Discount(Base):
    __tablename__ = 'discount'

    id = Column(INTEGER(11), primary_key=True)
    discount_scale = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='折扣比例')
    discount_name = Column(String(20), nullable=False, server_default=text("''"), comment='折扣名称')


class DjangoMigration(Base):
    __tablename__ = 'django_migrations'

    id = Column(INTEGER(11), primary_key=True)
    app = Column(String(255), nullable=False)
    name = Column(String(255), nullable=False)
    applied = Column(DATETIME(fsp=6), nullable=False)


class ElectricityRecharge(Base):
    __tablename__ = 'electricity_recharge'

    electricity_recharge_id = Column(INTEGER(11), primary_key=True, comment='电费充值表id')
    order_number = Column(String(50), nullable=False, server_default=text("''"), comment='单据号')
    device_name = Column(String(50), nullable=False, server_default=text("''"), comment='电表名称')
    room_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='房间id')
    room_number = Column(String(20), nullable=False, server_default=text("''"), comment='房间号')
    apartment_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='门店id')
    tenant_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='租客ID')
    table_name = Column(String(64), nullable=False, server_default=text("' '"), comment='来源表名')
    table_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='来源表id')
    degree = Column(String(10), nullable=False, server_default=text("'0'"), comment='度数')
    unit_price = Column(String(10), nullable=False, server_default=text("'0'"), comment='电费单价')
    money = Column(String(10), nullable=False, server_default=text("'0'"), comment='充值金额')
    status = Column(TINYINT(4), nullable=False, server_default=text("'0'"), comment='充值状态; 0：未成功; 1：成功 2：充值失败')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class Employee(Base):
    __tablename__ = 'employee'

    employee_id = Column(INTEGER(11), primary_key=True)
    isdelete_organization_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='组织ID')
    isdelete_company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    account = Column(String(50), nullable=False, server_default=text("''"), comment='账号')
    password = Column(String(32), nullable=False, server_default=text("''"), comment='密码')
    name = Column(String(20), nullable=False, server_default=text("''"), comment='姓名')
    phone = Column(String(11), nullable=False, server_default=text("''"), comment='手机号码')
    email = Column(String(200), nullable=False, server_default=text("''"), comment='email')
    avatar = Column(String(128), nullable=False, server_default=text("''"), comment='员工头像')
    isdelete_job_number = Column(String(50), nullable=False, server_default=text("''"), comment='工号')
    isdelete_joined_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='入职时间')
    gender = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='性别:(1、男；2、女)')
    birthday = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='生日')
    idcard = Column(String(50), nullable=False, server_default=text("''"), comment='身份证号码')
    isdelete_employee_group_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='分组ID')
    isdelete_employee_position_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='员工职位ID')
    isdelete_is_leaving = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否离职')
    isdelete_is_lnvestor = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否是甲方或者资方')
    auth_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='认证状态')
    remarks = Column(Text, comment='备注')
    isdelete_ding_talk_user_id = Column(String(32), nullable=False, server_default=text("''"), comment='钉钉ID')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class EmployeeApartmentRelation(Base):
    __tablename__ = 'employee_apartment_relation'

    employee_apartment_relation_id = Column(INTEGER(11), primary_key=True)
    organization_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='组织ID')
    employee_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='员工ID')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class EmployeeAppletLabel(Base):
    __tablename__ = 'employee_applet_label'

    employee_applet_label_id = Column(String(32), primary_key=True, server_default=text("'员工小程序标签主键'"))
    employee_id = Column(String(32), nullable=False, server_default=text("'员工主键'"))
    applet_label_id = Column(String(32), nullable=False, server_default=text("'小程序标签主键'"))
    applet_label_text = Column(String(32), server_default=text("''"), comment='小程序标签文本')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='1 正常，2 删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))


class EmployeeAttach(Base):
    __tablename__ = 'employee_attach'

    employee_attach_id = Column(INTEGER(11), primary_key=True)
    employee_id = Column(INTEGER(11), nullable=False, comment='用户ID')
    nickname = Column(String(50), nullable=False, server_default=text("' '"), comment='昵称')
    is_working = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='时候在上班状态')
    token = Column(String(255), nullable=False, server_default=text("'0'"), comment='友盟token')
    push_name = Column(String(20), nullable=False, server_default=text("''"), comment='推送服务商')
    device_name = Column(String(65), comment='设备名')
    app_name = Column(String(65), nullable=False, server_default=text("''"), comment='当前APP项目名称')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    umeng_token = Column(String(255), nullable=False, server_default=text("'0'"), comment='友盟token临时字段')


class EmployeeAuthCode(Base):
    __tablename__ = 'employee_auth_code'

    employee_auth_code_id = Column(INTEGER(11), primary_key=True)
    employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='员工id')
    auth_code = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='认证码')
    status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='状态 0不可用 1可用')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class EmployeeCityRelation(Base):
    __tablename__ = 'employee_city_relation'

    employee_city_relation_id = Column(INTEGER(11), primary_key=True)
    organization_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='组织ID')
    employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='员工ID')
    city_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='城市ID')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class EmployeeCompany(Base):
    __tablename__ = 'employee_company'
    __table_args__ = (
        Index('idx_employeeid_isleaving_issee_isdelete_employeepositionid', 'employee_id', 'is_leaving', 'is_see', 'is_delete', 'employee_position_id'),
        Index('idx_employeeid_organizationid_companyid', 'employee_id', 'organization_id', 'company_id')
    )

    employee_company_id = Column(INTEGER(11), primary_key=True)
    employee_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='员工ID')
    organization_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='组织ID')
    company_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='公司ID')
    job_number = Column(String(50), nullable=False, server_default=text("''"), comment='工号')
    joined_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='入职时间')
    employee_position_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='员工职位ID')
    ding_talk_user_id = Column(String(32), nullable=False, server_default=text("''"), comment='钉钉ID')
    is_leaving = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否离职')
    is_see = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否驻入1是0否')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='0正常，1删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class EmployeeCompanyCopy(Base):
    __tablename__ = 'employee_company_copy'

    employee_company_id = Column(INTEGER(11), primary_key=True)
    employee_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='员工ID')
    organization_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='组织ID')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    job_number = Column(String(50), nullable=False, server_default=text("''"), comment='工号')
    joined_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='入职时间')
    employee_position_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='员工职位ID')
    ding_talk_user_id = Column(String(32), nullable=False, server_default=text("''"), comment='钉钉ID')
    is_leaving = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否离职')
    is_see = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否驻入1是0否')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='0正常，1删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class EmployeeDeviceBinding(Base):
    __tablename__ = 'employee_device_binding'

    employee_device_binding_id = Column(INTEGER(11), primary_key=True)
    employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='员工id')
    employee_group_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='部门id')
    auth_account = Column(String(20), nullable=False, server_default=text("'0'"), comment='授权账户')
    client = Column(String(100), nullable=False, server_default=text("''"), comment='PC HOUSEKEEPER')
    device_type = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='设备类型 1个人设备 2公用设备')
    device_info = Column(String(100), nullable=False, server_default=text("''"), comment='设备信息')
    device_uuid = Column(String(100), nullable=False, server_default=text("''"), comment='设备信唯一识别码')
    status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='状态 0:已停用 1:生效中')
    remarks = Column(String(100), nullable=False, comment='备注')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class EmployeeGroup(Base):
    __tablename__ = 'employee_group'
    __table_args__ = (
        Index('employee_group_id', 'employee_group_id', 'organization_id', 'apartment_id'),
    )

    employee_group_id = Column(INTEGER(11), primary_key=True)
    organization_id = Column(INTEGER(1), nullable=False, server_default=text("'0'"), comment='组织ID')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    group_name = Column(String(20), nullable=False, server_default=text("'0'"), comment='分组名')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    parent_employee_group_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='分组上级ID')
    type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='类型(1职能，2业务,3分公司)')
    status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='状态(1启用，2停用)')
    remark = Column(String(255), nullable=False, server_default=text("''"), comment='备注')
    ding_talk_dept_id = Column(String(32), nullable=False, server_default=text("''"), comment='钉钉ID')
    sync_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否钉钉同步（1同步）')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class EmployeeGroupRelation(Base):
    __tablename__ = 'employee_group_relation'
    __table_args__ = (
        Index('idx_employeeid_employeegroupid_isleader', 'employee_id', 'employee_group_id', 'is_leader'),
        Index('idx_employeegroupid_isdelete_employeeid', 'employee_group_id', 'is_delete', 'employee_id'),
        Index('idx_employeeid_isdelete_employeegroupid', 'employee_id', 'is_delete', 'employee_group_id'),
        Index('idx_employeeid_employeegroupid', 'employee_id', 'employee_group_id')
    )

    employee_group_relation_id = Column(INTEGER(11), primary_key=True)
    organization_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='组织ID')
    employee_group_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='部门ID')
    employee_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='员工ID')
    is_leader = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否领导')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class EmployeePosition(Base):
    __tablename__ = 'employee_position'

    employee_position_id = Column(INTEGER(11), primary_key=True)
    organization_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='组织ID')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    position_name = Column(String(20), nullable=False, server_default=text("'0'"), comment='分组名')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class EmployeePublicDevice(Base):
    __tablename__ = 'employee_public_device'

    employee_public_device_id = Column(INTEGER(11), primary_key=True)
    client = Column(String(100), nullable=False, server_default=text("''"), comment='PC HouseKeeper')
    device_info = Column(String(100), nullable=False, server_default=text("''"), comment='设备信息')
    device_uuid = Column(String(100), nullable=False, server_default=text("''"), comment='设备信唯一识别码')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class EmployeeSaleDetail(Base):
    __tablename__ = 'employee_sale_detail'

    employee_sale_detail_id = Column(INTEGER(11), primary_key=True)
    create_date = Column(INTEGER(11), server_default=text("'0'"), comment='合同创建日期')
    bill_date = Column(INTEGER(11), server_default=text("'0'"), comment='交易日期')
    employee_id = Column(INTEGER(11), server_default=text("'0'"), comment='员工编号')
    area_id = Column(String(300), comment='大区id')
    company_id = Column(String(300), comment='公司id')
    group_id = Column(String(300), comment='部门id')
    apartment_id = Column(INTEGER(11), server_default=text("'0'"), comment='销售门店编号')
    city_id = Column(INTEGER(11), server_default=text("'0'"), comment='门店所在城市')
    data_type = Column(INTEGER(1), server_default=text("'1'"), comment='数据类型1:预定表2：合同表')
    contract_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='合同或预定合同id')
    service_type = Column(INTEGER(1), server_default=text("'1'"), comment='业务类型1:预定-定金2:直签3:续租4.预定转入住')
    room_number = Column(String(10), comment='房间编号')
    contract_cycle = Column(INTEGER(3), server_default=text("'0'"), comment='合同周期')
    uw = Column(INTEGER(1), nullable=False, server_default=text("'1'"), comment='上/带户 0:无状态 1：上户2：带户')
    rental = Column(DECIMAL(10, 2), server_default=text("'0.00'"), comment='合同月租金')
    service_fee = Column(DECIMAL(10, 2), server_default=text("'0.00'"), comment='月服务费')
    room_charge = Column(DECIMAL(10, 2), server_default=text("'0.00'"), comment='总房价')
    order_tc = Column(DECIMAL(10, 2), server_default=text("'0.00'"), comment='提成单量')
    order_amount = Column(INTEGER(1), server_default=text("'0'"), comment='分成人数')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class EmployeeSaleDetailSpare(Base):
    __tablename__ = 'employee_sale_detail_spare'

    employee_sale_detail_id = Column(INTEGER(11), primary_key=True)
    create_date = Column(INTEGER(11), server_default=text("'0'"), comment='合同创建日期')
    bill_date = Column(INTEGER(11), server_default=text("'0'"), comment='交易日期')
    employee_id = Column(INTEGER(11), server_default=text("'0'"), comment='员工编号')
    area_id = Column(String(300), comment='大区id')
    company_id = Column(String(300), comment='公司id')
    group_id = Column(String(300), comment='部门id')
    apartment_id = Column(INTEGER(11), server_default=text("'0'"), comment='销售门店编号')
    city_id = Column(INTEGER(11), server_default=text("'0'"), comment='门店所在城市')
    data_type = Column(INTEGER(1), server_default=text("'1'"), comment='数据类型1:预定表2：合同表')
    contract_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='合同或预定合同id')
    service_type = Column(INTEGER(1), server_default=text("'1'"), comment='业务类型1:预定-定金2:直签3:续租4.预定转入住')
    room_number = Column(String(10), comment='房间编号')
    contract_cycle = Column(INTEGER(3), server_default=text("'0'"), comment='合同周期')
    uw = Column(INTEGER(1), nullable=False, server_default=text("'1'"), comment='上/带户 0:无状态 1：上户2：带户')
    rental = Column(DECIMAL(10, 2), server_default=text("'0.00'"), comment='合同月租金')
    service_fee = Column(DECIMAL(10, 2), server_default=text("'0.00'"), comment='月服务费')
    room_charge = Column(DECIMAL(10, 2), server_default=text("'0.00'"), comment='总房价')
    order_tc = Column(DECIMAL(10, 2), server_default=text("'0.00'"), comment='提成单量')
    order_amount = Column(INTEGER(1), server_default=text("'0'"), comment='分成人数')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class EmployeeSalesChange(Base):
    __tablename__ = 'employee_sales_change'

    employee_sales_change_id = Column(String(32), primary_key=True, comment='员工销售任务变更主键ID')
    employee_sales_task_id = Column(String(32), nullable=False, comment='员工销售任务主键ID')
    change_record_id = Column(String(32), nullable=False, comment='门店销售任务变更主键ID')
    organization_id = Column(String(32), nullable=False, server_default=text("'0'"), comment='组织id')
    change_time = Column(INTEGER(11), server_default=text("'0'"), comment='变更时间')
    change_employee_id = Column(INTEGER(11), server_default=text("'0'"), comment='变更人')
    change_cause = Column(String(256), nullable=False, server_default=text("''"), comment='变更原因')
    before_change_number = Column(INTEGER(11), server_default=text("'0'"), comment='修改前任务数量')
    after_change_number = Column(INTEGER(11), server_default=text("'0'"), comment='修改后任务数量')
    change_source = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='来源(1:初始变更 2:中途变更 3:变更确认 )')
    operation_employee_id = Column(INTEGER(11), server_default=text("'0'"), comment='操作人编号')
    create_time = Column(INTEGER(11), server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), server_default=text("'0'"), comment='修改时间')
    delete_status = Column(TINYINT(4), server_default=text("'0'"), comment='删除状态(1:未删除,2:已删除)')
    delete_time = Column(INTEGER(11), server_default=text("'0'"), comment='删除时间')


class EmployeeSalesJob(Base):
    __tablename__ = 'employee_sales_job'

    employee_sales_job_id = Column(String(32), primary_key=True, comment='员工销售工作主键ID')
    employee_sales_task_id = Column(String(32), nullable=False, comment='员工销售任务主键ID')
    organization_id = Column(String(32), nullable=False, comment='组织ID')
    apartment_id = Column(INTEGER(11), server_default=text("'0'"), comment='门店ID')
    employee_id = Column(INTEGER(11), server_default=text("'0'"), comment='员工ID')
    employee_position_id = Column(String(32), nullable=False, comment='员工职务ID')
    department = Column(INTEGER(11), server_default=text("'0'"), comment='部门 {0：门店人员}')
    create_time = Column(INTEGER(11), server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), server_default=text("'0'"), comment='修改时间')
    delete_status = Column(TINYINT(4), server_default=text("'0'"), comment='删除状态(1:未删除,2:已删除)')
    delete_time = Column(INTEGER(11), server_default=text("'0'"), comment='删除时间')


class EmployeeSalesTask(Base):
    __tablename__ = 'employee_sales_task'

    employee_sales_task_id = Column(String(32), primary_key=True, comment='员工销售任务主键ID')
    apartment_sales_task_id = Column(String(32), nullable=False, comment='门店销售任务主键ID')
    organization_id = Column(String(32), nullable=False, server_default=text("'0'"), comment='组织id')
    apartment_id = Column(INTEGER(11), server_default=text("'0'"), comment='门店ID')
    employee_id = Column(INTEGER(11), server_default=text("'0'"), comment='员工ID')
    employee_position_id = Column(String(32), nullable=False, comment='员工职务ID')
    start_time = Column(INTEGER(11), server_default=text("'0'"), comment='任务开始时间')
    end_time = Column(INTEGER(11), server_default=text("'0'"), comment='任务结束时间')
    task_number = Column(INTEGER(11), server_default=text("'0'"), comment='销售任务数量')
    added_number = Column(INTEGER(11), server_default=text("'0'"), comment='额外销售任务数量')
    sale_task_number = Column(INTEGER(11), server_default=text("'0'"), comment='销售成交量')
    sale_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='销售金额')
    status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='员工任务是否确认 {1：未确认 2： 已确认，3：自动确认}')
    department = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='部门 {0：门店人员}')
    create_time = Column(INTEGER(11), server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), server_default=text("'0'"), comment='修改时间')
    delete_status = Column(TINYINT(4), server_default=text("'0'"), comment='删除状态(1:未删除,2:已删除)')
    delete_time = Column(INTEGER(11), server_default=text("'0'"), comment='删除时间')


class EquipmentInformation(Base):
    __tablename__ = 'equipment_information'

    equipment_information_id = Column(INTEGER(11), primary_key=True, comment='设备信息ID')
    system_cdk_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='密钥ID')
    hard_disk_number = Column(String(128), nullable=False, server_default=text("' '"), comment='硬盘编号')
    client = Column(String(32), nullable=False, server_default=text("'PC'"), comment='端')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='创建时间')
    cpu_number = Column(String(128), nullable=False, server_default=text("' '"), comment='cpu编号')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='更新时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间')


class ErrorLog(Base):
    __tablename__ = 'error_log'

    error_log_id = Column(String(32), primary_key=True, comment='主键UUID')
    request_url = Column(String(32), comment='请求路径')
    method = Column(String(255), comment='请求方式')
    header = Column(String(1024), comment='请求头')
    request_data = Column(String(1024), comment='请求信息')
    error_code = Column(String(255), comment='异常错误码')
    error_msg = Column(String(1024), comment='异常描述')
    error_data = Column(String(1024), comment='异常返回')
    create_time = Column(INTEGER(10), server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(10), server_default=text("'0'"), comment='修改时间')
    delete_status = Column(TINYINT(1), server_default=text("'1'"), comment='是否删除(2 删除，1 正常)')
    delete_time = Column(INTEGER(10), server_default=text("'0'"), comment='删除时间')


class EtlLog(Base):
    __tablename__ = 'etl_log'

    id = Column(INTEGER(11), primary_key=True)
    bill_id = Column(INTEGER(11), nullable=False)
    error_type = Column(TINYINT(4), nullable=False, comment='1mongo,0正常,2redis')
    create_at = Column(INTEGER(11), nullable=False, comment='时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class ExpandEmployee(Base):
    __tablename__ = 'expand_employee'

    expand_employee_id = Column(String(32), primary_key=True)
    employee_id = Column(INTEGER(11), nullable=False, index=True, comment='员工主键')
    expand_type = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='拓展类型(1中台员工)')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, index=True, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class FanciNotifyInfo(Base):
    __tablename__ = 'fanci_notify_info'

    fanci_notify_info_id = Column(INTEGER(11), primary_key=True)
    notify_content = Column(Text, comment='发起回调内容')
    notify_return = Column(Text, comment='发起回调后返回内容')
    notify_url = Column(String(255), nullable=False, server_default=text("''"), comment='回调地址')
    notify_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='回调状态0未回调 1回调失败 2回调成功')
    notify_count = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='回调次数')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class FanleBaitiaoApartmentConfigurtion(Base):
    __tablename__ = 'fanle_baitiao_apartment_configurtion'

    id = Column(INTEGER(11), primary_key=True, comment='自增id')
    fanle_baitiao_apartment_configurtion_id = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='关联ID')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    is_open = Column(INTEGER(11), nullable=False, server_default=text("'1'"), comment='是否开启白条1否2是')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    delete_status = Column(TINYINT(2), nullable=False, server_default=text("'1'"), comment='是否删除1否2是')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')


class FanleBaitiaoLoanNotify(Base):
    __tablename__ = 'fanle_baitiao_loan_notify'

    id = Column(INTEGER(11), primary_key=True)
    fanle_baitiao_loan_notify_id = Column(String(64), nullable=False, server_default=text("''"), comment='放款主键ID')
    bill_id = Column(String(64), nullable=False, server_default=text("''"), comment='账单id')
    reality_price = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='实际放款金额')
    repayment = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='放款完成时间')
    iou_repscd = Column(String(10), nullable=False, server_default=text("''"), comment='放款状态 00放款成功')
    price = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='订单金额')
    type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='放款类型 0租客支付 1刚性兑付 2提前清偿')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='1正常 2删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改实际')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    bank_reality_price = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='银行放款金额')


class FanleBaitiaoRepayment(Base):
    __tablename__ = 'fanle_baitiao_repayment'
    __table_args__ = (
        Index('instalment', 'instalment', 'fanle_baitiao_submit_bill_id'),
    )

    id = Column(INTEGER(11), primary_key=True, comment='主键id')
    fanle_baitiao_repayment_id = Column(String(64), nullable=False, server_default=text("''"), comment='提交白条分期主键ID')
    repayment_id = Column(String(64), nullable=False, server_default=text("'0'"), comment='白条系统还款计划id')
    iou_bill_id = Column(String(64), nullable=False, server_default=text("'0'"), comment='白条系统账单id')
    created_date = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='白条系统创建时间(白条系统返回)')
    begin_date = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='白条开始还款时间')
    end_date = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='白条还款结束时间')
    instalment_sum = Column(TINYINT(1), nullable=False, server_default=text("'3'"), comment='分期期数默认3')
    instalment = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='当前分期次数')
    price = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='月账单金额')
    interest = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='月账单利息')
    overdue_day = Column(TINYINT(2), nullable=False, server_default=text("'0'"), comment='逾期天数')
    reality_interest = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='实际偿还利息')
    reality_price = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='实际偿还金额')
    store_code = Column(String(10), nullable=False, server_default=text("''"), comment='门店code 对应apartment里的apartment_code')
    apartment_code = Column(String(10), nullable=False, server_default=text("'lefu'"), comment='乐乎系统编码 默认lefu')
    type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='0租客支付 1刚性兑付 2提前清偿 3线下还款')
    business_code = Column(String(10), nullable=False, server_default=text("''"), comment='默认为空 乐乎编码0301 泛乐编码0001')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否删除; 1:正常, 2:删除')
    fanle_baitiao_submit_bill_id = Column(String(64), nullable=False, server_default=text("''"), comment='fanle_baitiao_submit_bill 主键 ID')
    repayment_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='分期计划的还款状态 0未还款 1已还款')
    repayment_date = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='还款完成日期')
    service_charge_rate = Column(DECIMAL(10, 4), nullable=False, server_default=text("'0.0000'"), comment='支付手续费')
    late_fee = Column(DECIMAL(10, 0), nullable=False, server_default=text("'0'"), comment='滞纳金')


class FanleBaitiaoSubmitBill(Base):
    __tablename__ = 'fanle_baitiao_submit_bill'

    id = Column(INTEGER(11), primary_key=True, comment='主键id')
    fanle_baitiao_submit_bill_id = Column(String(64), nullable=False, server_default=text("''"), comment='提交白条主键ID')
    iou_id = Column(String(64), nullable=False, server_default=text("'0'"), comment='白条系统id')
    business_id = Column(String(64), nullable=False, index=True, server_default=text("''"), comment='账单号 对应contract_ious里的bill_id')
    open_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='用户id对应tenant表的tenant_id')
    created_date = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='白条系统创建时间(白条系统返回)')
    begin_date = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='白条开始还款时间')
    end_date = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='白条还款结束时间')
    instalment_sum = Column(TINYINT(1), nullable=False, server_default=text("'3'"), comment='分期期数默认3')
    instalment = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='已还分期数')
    price = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='分期总金额')
    interest = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='分期总利息')
    reality_interest = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='实际偿还利息')
    reality_price = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='实际偿还金额')
    store_code = Column(String(10), nullable=False, server_default=text("''"), comment='门店code 对应apartment里的apartment_code')
    phone = Column(LargeBinary, nullable=False, comment='手机号码')
    roomno = Column(String(20), nullable=False, server_default=text("''"), comment='房间编号 对应 room room_number')
    client_name = Column(String(25), nullable=False, server_default=text("''"), comment='租客姓名 对应 tenant name')
    apartment_code = Column(String(10), nullable=False, server_default=text("'lefu'"), comment='乐乎系统编码 默认lefu')
    business_code = Column(String(10), nullable=False, server_default=text("'0301'"), comment='乐乎编码')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否删除; 1:正常, 2:删除')
    store_key = Column(String(32), nullable=False, server_default=text("''"), comment='店铺key apartment 表里unique_id')
    bill_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='o正常 1退租')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='店铺id')
    late_fee = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='滞纳金')


class FeignError(Base):
    __tablename__ = 'feign_error'

    feign_error_id = Column(INTEGER(11), primary_key=True, comment='ID')
    service_id = Column(String(255), nullable=False, server_default=text("''"), comment='服务ID')
    api_path = Column(String(255), nullable=False, server_default=text("''"), comment='接口路径')
    method = Column(String(10), nullable=False, server_default=text("''"), comment='请求方式')
    data = Column(Text, nullable=False, comment='参数')
    form_type = Column(String(50), nullable=False, server_default=text("''"), comment='form—type')
    header = Column(String(255), nullable=False, server_default=text("''"), comment='头信息')
    https = Column(String(2), nullable=False, server_default=text("''"), comment='是否https')
    result = Column(Text, nullable=False, comment='接口返回')
    status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='状态 1失败，2成功')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class FinanceSequence(Base):
    __tablename__ = 'finance_sequence'

    finance_sequence_id = Column(INTEGER(11), primary_key=True)
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    bank_account_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='核销账户')
    write_off_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='核销金额')
    bank_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='银行存款')
    cash_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='现金')
    finance_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='账务费用')
    finance_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='收入支出')
    document_number = Column(String(255), nullable=False, server_default=text("''"), comment='核销编号')
    post_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='入账时间')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class FinancialConfigure(Base):
    __tablename__ = 'financial_configure'

    id = Column(INTEGER(11), primary_key=True, comment='财务配置id')
    merchant_id = Column(String(255), nullable=False, server_default=text("''"), comment='商户号')
    weeks = Column(String(64), nullable=False, server_default=text("''"), comment=' 星期几')
    is_timing = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='是否定时任务执行 0-手动 1 自动')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class FixPriceApply(Base):
    __tablename__ = 'fix_price_apply'

    fix_price_apply_id = Column(INTEGER(11), primary_key=True)
    apply_name = Column(String(32), nullable=False, server_default=text("''"), comment='申请单名称')
    apartment_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='申请门店ID')
    employee_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='申请人ID')
    employee_group_name = Column(String(255), nullable=False, server_default=text("''"), comment='申请人部门(多部门由 ‘,’ 隔开)')
    current_approver = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='当前审批人')
    history_approver = Column(String(255), nullable=False, server_default=text("''"), comment='历史审批人, 便于列表计算分页')
    apply_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='申请类型: 1:涨价; 2:降价')
    apply_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='申请时间')
    approval_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='审批类型: 1, 调价审批; 2, 保底价审批')
    modify_price_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='审批状态: 1.初级审批; 2.高级审批; 3.集团审批')
    bottom_price_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='保底价审批节点: 1.城市公司商务负责人、2.城市财务负责人、3.城市总经理、4.集团租务、5.集团财务')
    approval_result = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='审批结果: 0.审批中; 1.已通过; 2.已终止')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class FixPriceApplyRelation(Base):
    __tablename__ = 'fix_price_apply_relation'

    relation_id = Column(INTEGER(11), primary_key=True)
    fix_price_apply_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='申请表ID')
    room_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='申请房间id')
    fix_price = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='当前定价')
    current_price = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='当前售价')
    apply_price = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='申请调整价格')
    fix_price_rate = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='定价比率')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class FixPriceApproval(Base):
    __tablename__ = 'fix_price_approval'

    fix_price_approval_id = Column(INTEGER(11), primary_key=True)
    fix_price_apply_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='定价申请表id')
    approver_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='审批人ID')
    next_approver_id = Column(INTEGER(10), nullable=False, index=True, server_default=text("'0'"), comment='下一步审核人ID')
    process_type = Column(TINYINT(4), nullable=False, server_default=text("'0'"), comment='处理类型: 1:系统; 2:人工')
    process_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='处理时间')
    process_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='处理状态: 0:待审批; 1.已审批; 2.已拒绝;')
    process_reason = Column(String(200), nullable=False, server_default=text("''"), comment='处理原因')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class FixPriceLog(Base):
    __tablename__ = 'fix_price_log'

    fix_price_log_id = Column(INTEGER(11), primary_key=True)
    fix_price_apply_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='定价申请表ID')
    fix_price_approval_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='定价审批表ID')
    log_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='日志类型: 1.申请改售价; 2.批量改定价')
    room_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='申请房间id')
    apartment_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='申请门店ID')
    ridgepole_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='楼栋ID')
    employee_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='申请人ID')
    employee_group_name = Column(String(255), nullable=False, server_default=text("''"), comment='申请人部门(多部门由 ‘,’ 隔开)')
    apply_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='申请时间')
    before_fix_price = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='修改前定价')
    after_fix_price = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='修改后定价')
    before_sell_price = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='修改前售价')
    after_sell_price = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='修改后售价')
    executor_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='执行者ID')
    process_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='处理时间')
    process_status = Column(String(5), nullable=False, server_default=text("''"), comment='处理状态: 0:待审批; 1.已审批; 2.已拒绝;')
    modify_price_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='处理状态: 1.初级审批; 2.高级审批; 3.集团审批')
    bottom_price_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='保底价审批节点: 1.城市公司商务负责人、2.城市财务负责人、3.城市总经理、4.集团租务、5.集团财务')
    process_reason = Column(String(200), nullable=False, server_default=text("''"), comment='处理原因')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class Floor(Base):
    __tablename__ = 'floor'

    floor_id = Column(INTEGER(11), primary_key=True)
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公寓ID')
    ridgepole_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='楼栋ID')
    floor_number = Column(String(20), nullable=False, server_default=text("''"), comment='楼层编号')
    order_number = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='排序')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class GeneralClient(Base):
    __tablename__ = 'general_client'

    client_id = Column(INTEGER(11), primary_key=True)
    client_code = Column(String(64), nullable=False, server_default=text("''"), comment='客户端CODE')
    name = Column(String(255), nullable=False, server_default=text("''"), comment='说明')
    client_key = Column(String(64), nullable=False, server_default=text("''"), comment='每个端唯一识别key')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class GeneralMessagePush(Base):
    __tablename__ = 'general_message_push'

    general_message_push_id = Column(INTEGER(11), primary_key=True)
    message_name = Column(String(255), nullable=False, server_default=text("''"), comment='消息名')
    message_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='消息类型: 1财务收入 2服务预约 3合同变更')
    push_code = Column(String(200), nullable=False, server_default=text("''"), comment='推送业务code 包含场景code')
    from_client_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='产生推送的客户端id')
    push_client_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='接收推送的客户端id')
    return_data = Column(String(255), nullable=False, server_default=text("''"), comment='返回数据 链接或者数组')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    room_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='房间ID')
    room_number = Column(String(20), nullable=False, server_default=text("''"), comment='房间号')
    employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='员工ID')
    status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='消息状态 0未处理 1已处理')
    processing_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='处理时间')
    table_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='产生推送的表id')
    table_name = Column(String(64), nullable=False, server_default=text("''"), comment='产生推送的表名称')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


t_gmv_day_flow = Table(
    'gmv_day_flow', metadata,
    Column('room_id', INTEGER(10), nullable=False, server_default=text("'0'"), comment='房间ID'),
    Column('room_number', String(20), nullable=False, server_default=text("''"), comment='房间编号'),
    Column('contract_id', INTEGER(10), nullable=False, server_default=text("'0'"), comment='合同ID'),
    Column('apartment_id', INTEGER(10), nullable=False, server_default=text("'0'"), comment='门店ID'),
    Column('contract_begin_time', INTEGER(10), nullable=False, server_default=text("'0'"), comment='合同开始时间'),
    Column('contract_end_time', INTEGER(10), nullable=False, server_default=text("'0'"), comment='合同结束时间'),
    Column('deposit_month', TINYINT(2), nullable=False, server_default=text("'0'"), comment='押金付几月'),
    Column('rent_month', TINYINT(2), nullable=False, server_default=text("'0'"), comment='租金付几月'),
    Column('ious_type', TINYINT(1), nullable=False, server_default=text("'0'"), comment='分期类型 0季付 1乐乎分期 2门店分期'),
    Column('contract_status', TINYINT(1), nullable=False, server_default=text("'0'"), comment='合同状态 0未知 1在住 2正常退租 3违约退租'),
    Column('surrender_time', INTEGER(10), nullable=False, server_default=text("'0'"), comment='退租时间'),
    Column('preordain_time', INTEGER(10), nullable=False, server_default=text("'0'"), comment='预定时间'),
    Column('preordain_id', INTEGER(10), nullable=False, server_default=text("'0'"), comment='预定ID'),
    Column('contract_rental', DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='合同租金'),
    Column('service_fee', DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='服务费'),
    Column('total_rental_coupon', DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='租金优惠'),
    Column('total_service_fee_coupon', DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='服务费优惠'),
    Column('current_term', TINYINT(1), nullable=False, server_default=text("'0'"), comment='当前期数'),
    Column('current_term_days', TINYINT(1), nullable=False, server_default=text("'0'"), comment='当期天数'),
    Column('rental_income', DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='当日租金收入'),
    Column('service_fee_income', DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='当日服务费收入'),
    Column('ious_service_fee', DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='当日分期服务费'),
    Column('rental_coupon', DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='当日租金优惠'),
    Column('service_fee_coupon', DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='当日服务费优惠'),
    Column('deposit_penalty', DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='押金违约金'),
    Column('service_fee_repair', DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='服务费补收'),
    Column('rental_repair', DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='租金补收'),
    Column('ious_service_fee_repair', DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='分期服务费补收'),
    Column('ious_penalty', DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='分期违约金'),
    Column('ious_service_back', DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='服务费优惠扣回'),
    Column('rental_back', DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='租金优惠扣回'),
    Column('super_income', DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='超房收入'),
    Column('current_day', INTEGER(10), nullable=False, server_default=text("'0'"), comment='日报日期'),
    Column('delete_status', TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除'),
    Column('create_time', INTEGER(10), nullable=False, server_default=text("'0'"), comment='新增时间'),
    Column('update_time', INTEGER(10), nullable=False, server_default=text("'0'"), comment='修改时间'),
    Column('delete_time', INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间')
)


class GmvExcelUrl(Base):
    __tablename__ = 'gmv_excel_url'

    url_id = Column(VARCHAR(32), primary_key=True)
    apartment_id = Column(VARCHAR(32), server_default=text("''"), comment='门店id')
    apartment_name = Column(VARCHAR(255), server_default=text("''"), comment='门店名')
    account_period = Column(VARCHAR(255), server_default=text("''"), comment='账期(月份)')
    excel_url = Column(VARCHAR(255), server_default=text("''"), comment='excel地址')
    delete_status = Column(TINYINT(1), server_default=text("'1'"), comment='删除状态：1可用 2删除')
    create_time = Column(INTEGER(10), server_default=text("'0'"))
    delete_time = Column(INTEGER(10), server_default=text("'0'"))
    update_time = Column(INTEGER(10), server_default=text("'0'"))


class Good(Base):
    __tablename__ = 'goods'

    goods_id = Column(INTEGER(11), primary_key=True, comment='ID')
    goods_picture = Column(String(500), nullable=False, server_default=text("''"), comment='商品首页图')
    goods_name = Column(String(500), nullable=False, server_default=text("''"), comment='商品名称')
    goods_title = Column(String(500), nullable=False, server_default=text("''"), comment='商品副标题')
    price = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='金额')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class GoodsDetail(Base):
    __tablename__ = 'goods_details'

    goods_details_id = Column(INTEGER(11), primary_key=True, comment='ID')
    goods_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='商品ID')
    goods_details_picture_url = Column(String(500), nullable=False, server_default=text("''"), comment='详情网络路径')
    goods_details_name = Column(String(500), nullable=False, server_default=text("''"), comment='图片名称')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class GoodsLoopPicture(Base):
    __tablename__ = 'goods_loop_picture'

    goods_loop_picture_id = Column(INTEGER(11), primary_key=True, comment='ID')
    goods_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='商品ID')
    goods_loop_picture_url = Column(String(500), nullable=False, server_default=text("''"), comment='轮播图网络路径')
    goods_loop_picture_name = Column(String(500), nullable=False, server_default=text("''"), comment='图片名称')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class House(Base):
    __tablename__ = 'house'

    house_id = Column(INTEGER(11), primary_key=True)
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    floor_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='楼层ID')
    ridgepole_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='栋ID')
    house_number = Column(String(255), nullable=False, server_default=text("''"), comment='房源编号')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class HsbankLimitConfig(Base):
    __tablename__ = 'hsbank_limit_config'

    hsbank_limit_config_id = Column(INTEGER(11), primary_key=True)
    pay_channel_name = Column(String(16), nullable=False, server_default=text("''"), comment='支付渠道名称')
    pay_channel = Column(String(16), nullable=False, server_default=text("''"), comment='支付渠道')
    bank_name = Column(String(16), nullable=False, server_default=text("''"), comment='银行名称')
    bank_code = Column(String(16), nullable=False, server_default=text("''"), comment='银行代码code')
    recharge_single_limit = Column(DECIMAL(6, 2), nullable=False, server_default=text("'0.00'"), comment='充值单笔限额')
    recharge_single_day_limit = Column(DECIMAL(6, 2), nullable=False, server_default=text("'0.00'"), comment='充值单日限额')
    withdraw_single_limit = Column(DECIMAL(6, 2), nullable=False, server_default=text("'0.00'"), comment='提现单笔限额')
    withdraw_single_day_limit = Column(DECIMAL(6, 2), nullable=False, server_default=text("'0.00'"), comment='提现单日限额')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除; 1:未删除; 2:已删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class InstalmentEarningDetail(Base):
    __tablename__ = 'instalment_earning_detail'

    instalment_earning_detail_id = Column(INTEGER(11), primary_key=True)
    tenant_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='租客ID')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    room_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='房间ID')
    count_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='统计时间(精确到秒)')
    bill_id = Column(String(64), nullable=False, index=True, server_default=text("'0'"), comment='账单ID')
    cost_amount = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='金额')
    delete_status = Column(TINYINT(1), nullable=False, index=True, server_default=text("'1'"), comment='是否删除; 1:正常, 2:删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class InstalmentEarningMonthCount(Base):
    __tablename__ = 'instalment_earning_month_count'

    instalment_earning_month_count_id = Column(INTEGER(11), primary_key=True)
    company_region_name = Column(String(20), nullable=False, server_default=text("''"), comment='区域公司名称')
    company_region_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='区域公司ID')
    contract_number = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='分期使用数量')
    instalment_number = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='合同有效数量')
    lastMonth_count_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='上月分期收入总额')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    apartment_name = Column(String(20), nullable=False, server_default=text("''"), comment='门店名称')
    count_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='查询月分期汇总金额')
    lefull_count_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='乐乎汇总金额')
    jinjie_count_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='金捷汇总金额')
    last_yearcount_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='上年同月分期收入总额')
    summary_time = Column(String(20), nullable=False, server_default=text("''"), comment='汇总时间(按月)')
    delete_status = Column(TINYINT(1), nullable=False, index=True, server_default=text("'1'"), comment='是否删除; 1:正常, 2:删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class InstalmentServiceFeeDetail(Base):
    __tablename__ = 'instalment_service_fee_detail'

    id = Column(INTEGER(11), primary_key=True, comment='分期手续费导入详情id')
    statistics_date = Column(String(20, 'utf8mb4_unicode_ci'), nullable=False, server_default=text("''"), comment='统计日期(2019-11)')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店id')
    apartment_name = Column(String(20, 'utf8mb4_unicode_ci'), nullable=False, server_default=text("''"), comment='门店名称')
    city_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='城市id')
    city = Column(String(20, 'utf8mb4_unicode_ci'), nullable=False, server_default=text("''"), comment='城市')
    instalment_capital_name = Column(String(20, 'utf8mb4_unicode_ci'), nullable=False, server_default=text("''"), comment='分期资方')
    lefull_instalment_service_fee = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='乐乎分期手续费')
    instalment_service_fee = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='分期手续费')
    import_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='导入状态 1未导入，2已导入')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否删除; 1:正常, 2:删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), server_default=text("'0'"), comment='更新时间')
    delete_time = Column(INTEGER(11), server_default=text("'0'"), comment='删除时间')


class IntelligentAmmeter(Base):
    __tablename__ = 'intelligent_ammeter'

    ammeter_id = Column(INTEGER(11), primary_key=True)
    device_code = Column(String(100), nullable=False, comment='智能设备device_code')
    api_interface = Column(String(50), nullable=False, server_default=text("''"), comment='接口')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    room_number = Column(String(20), nullable=False, server_default=text("''"), comment='房间编号')
    room_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='房间ID')
    device_uuid = Column(String(100), nullable=False, server_default=text("''"), comment='电表设备uuid')
    gateway_code = Column(String(15), nullable=False, server_default=text("''"), comment='集中器编号')
    device_sn = Column(String(64), nullable=False, server_default=text("''"), comment='设备编号')
    price = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='目前单价')
    surplus = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='剩余电量')
    switch_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='开关状态 0-断电 1-通电')
    pay_mode = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='付费模式  0 预付 1后付')
    ammeter_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='设备状态 1正常使用 2空置')
    online_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否在线 0在线 1离线')
    syn_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='同步时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    account = Column(String(100), nullable=False, server_default=text("''"), comment='电表绑定账号')


class IntelligentAmmeterApartmentConf(Base):
    __tablename__ = 'intelligent_ammeter_apartment_conf'

    ammeter_apartment_conf_id = Column(INTEGER(11), primary_key=True)
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    price = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='目前单价')
    pay_mode = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='付费模式  0 预付 1后付')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')


class IntelligentAmmeterOperatorLog(Base):
    __tablename__ = 'intelligent_ammeter_operator_log'

    ammeter_operator_log_id = Column(INTEGER(11), primary_key=True)
    ammeter_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='智能电表主表ID')
    modify_field = Column(String(64), nullable=False, server_default=text("''"), comment='被修改的字段')
    before_modify_value = Column(String(64), nullable=False, server_default=text("''"), comment='修改前值')
    after_modify_value = Column(String(64), nullable=False, server_default=text("''"), comment='修改后值')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改人')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')


class IntelligentAmmeterRecharge(Base):
    __tablename__ = 'intelligent_ammeter_recharge'

    ammeter_recharge_id = Column(INTEGER(11), primary_key=True, comment='智能电费充值表id')
    ammeter_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='智能电表主表ID')
    room_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='房间id')
    room_number = Column(String(20), nullable=False, server_default=text("''"), comment='房间号')
    apartment_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='门店id')
    tenant_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='租客ID')
    value = Column(String(10), nullable=False, server_default=text("'0'"), comment='度数')
    unit_price = Column(String(10), nullable=False, server_default=text("'0'"), comment='充值时电费单价')
    money = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='充值金额')
    status = Column(TINYINT(4), nullable=False, server_default=text("'0'"), comment='充值状态; 0：未成功; 1：成功 2：充值失败')
    pay_status = Column(TINYINT(4), nullable=False, server_default=text("'0'"), comment='支付状态 0未支付，1支付中，2取消支付，3支付失败，4支付成功,5支付金额错误')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class IntelligentAmmeterRecord(Base):
    __tablename__ = 'intelligent_ammeter_record'
    __table_args__ = (
        Index('idx_con_room', 'contract_id', 'room_id'),
    )

    intelligent_ammeter_record_id = Column(INTEGER(10), primary_key=True, comment='主键ID')
    contract_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='合同ID')
    room_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='房价ID')
    device_no = Column(String(20), nullable=False, server_default=text("''"), comment='设备号')
    power = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='充值电量')
    op_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='充值时间')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否删除; 1:正常; 2:已删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class IntelligentAmmeterSynchroInfo(Base):
    __tablename__ = 'intelligent_ammeter_synchro_info'

    ammeter_synchro_info_id = Column(INTEGER(11), primary_key=True)
    ammeter_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='智能电表主表ID')
    synchro_url = Column(String(255), nullable=False, server_default=text("''"), comment='同步地址')
    synchro_param = Column(MEDIUMTEXT, nullable=False, comment='同步参数内容')
    synchro_return = Column(MEDIUMTEXT, nullable=False, comment='同步接口结果返回')
    synchro_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='同步状态（0：未同步，1：同步成功，2：同步失败）')
    synchro_count = Column(TINYINT(2), nullable=False, server_default=text("'0'"), comment='同步次数')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class IntelligentDevice(Base):
    __tablename__ = 'intelligent_device'

    intelligent_device_id = Column(INTEGER(11), primary_key=True, comment='主键ID')
    device_code = Column(String(30), nullable=False, server_default=text("''"), comment='设备编码全局唯一')
    device_name = Column(String(30), nullable=False, server_default=text("''"), comment='设备名')
    device_info = Column(String(30), nullable=False, server_default=text("''"), comment='设备描述')
    api_interface = Column(String(30), nullable=False, server_default=text("''"), comment='接口')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='更新时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间')


class IntelligentGateway(Base):
    __tablename__ = 'intelligent_gateway'

    intelligent_gateway_id = Column(String(32, 'utf8mb4_unicode_ci'), primary_key=True, comment='网关主键ID')
    device_uuid = Column(String(32, 'utf8mb4_unicode_ci'), nullable=False, server_default=text("''"), comment='网关编码（intelligent_lock表的device_uuid字段）')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    off_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='通信状态：1在线，2离线')
    operator_company = Column(String(50, 'utf8mb4_unicode_ci'), nullable=False, server_default=text("''"), comment='运营商')
    hardware_version = Column(String(50, 'utf8mb4_unicode_ci'), nullable=False, server_default=text("''"), comment='硬件版本')
    system_version = Column(String(50, 'utf8mb4_unicode_ci'), nullable=False, server_default=text("''"), comment='当前嵌入式版本')
    address = Column(String(50, 'utf8mb4_unicode_ci'), nullable=False, comment='安装地址')
    house_code = Column(String(50, 'utf8mb4_unicode_ci'), nullable=False, server_default=text("''"), comment='房源编码')
    remark = Column(String(50, 'utf8mb4_unicode_ci'), nullable=False, server_default=text("''"), comment='备注')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='创建时间')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='删除状态：1正常，2删除')
    off_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='上线/离线时间')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='修改时间')


class IntelligentLock(Base):
    __tablename__ = 'intelligent_lock'
    __table_args__ = (
        Index('idx_apartmentid_isdelete', 'apartment_id', 'is_delete'),
    )

    lock_id = Column(INTEGER(11), primary_key=True, comment='主键ID')
    device_code = Column(String(30), nullable=False, server_default=text("''"), comment='设备编码全局唯一')
    apartment_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='门店ID')
    room_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='room_id')
    room_number = Column(String(20), nullable=False, server_default=text("''"), comment='房间编号')
    house_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='house_id')
    floor_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='楼层ID')
    ridgepole_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='楼栋ID')
    api_interface = Column(String(20), nullable=False, comment='接口')
    lock_code = Column(String(50), nullable=False, server_default=text("''"), comment='房源锁唯一标识')
    device_sn = Column(String(32), nullable=False, index=True, server_default=text("''"), comment='设备SN编号')
    device_uuid = Column(String(32), nullable=False, server_default=text("''"), comment='设备UUID')
    electric = Column(TINYINT(3), nullable=False, server_default=text("'0'"), comment='电量')
    online_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否离线 0：在线，1：离线')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='更新时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间')
    dd_room_id = Column(String(64), server_default=text("''"), comment='云丁房间编号')
    dd_home_id = Column(String(64), server_default=text("''"), comment='云丁房源编号')
    lock_type = Column(String(64), nullable=False, server_default=text("''"), comment='门锁类型')
    install_time = Column(INTEGER(11), server_default=text("'0'"), comment='安装时间')


class IntelligentLockDdingExtend(Base):
    __tablename__ = 'intelligent_lock_dding_extends'

    lock_dding_extends_id = Column(INTEGER(11), primary_key=True, comment='主键ID')
    lock_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门锁ID')
    service = Column(String(50), nullable=False, server_default=text("''"), comment='回调类别')
    serviceid = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='回调服务ID')
    old_password = Column(String(50), nullable=False, server_default=text("''"), comment='老密码')
    device_uuid = Column(String(32), nullable=False, index=True, server_default=text("''"), comment='设备UUID')
    password_uuid = Column(String(8), nullable=False, server_default=text("'0'"), comment='密码编号')
    errno = Column(String(32), nullable=False, server_default=text("''"), comment='错误码')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='更新时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间')


t_intelligent_lock_frozen_log = Table(
    'intelligent_lock_frozen_log', metadata,
    Column('lock_id', INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='门锁ID'),
    Column('frozen_status', TINYINT(1), nullable=False, server_default=text("'0'"), comment='密码冻结状态 0解冻，1冻结'),
    Column('operator_employee_id', INTEGER(10), nullable=False, server_default=text("'0'"), comment='操作人ID'),
    Column('create_time', INTEGER(10), nullable=False, server_default=text("'0'"), comment='冻结时间'),
    Column('update_time', INTEGER(10), nullable=False, server_default=text("'0'"), comment='修改时间'),
    Column('is_delete', TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除'),
    Column('delete_time', INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间')
)


class IntelligentLockNotifyLog(Base):
    __tablename__ = 'intelligent_lock_notify_log'

    lock_notify_log_id = Column(INTEGER(11), primary_key=True)
    lock_api_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='API请求类型 1-回写SN 2-回写电量 3-回写在线状态 4-回写开门记录')
    device_sn = Column(String(32), nullable=False, index=True, server_default=text("''"), comment='锁SN')
    notify_data = Column(MEDIUMTEXT, nullable=False, comment='接口数据')
    api_ip = Column(String(16), nullable=False, server_default=text("''"), comment='请求IP')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='请求时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


t_intelligent_lock_online_log = Table(
    'intelligent_lock_online_log', metadata,
    Column('lock_id', INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='门锁ID'),
    Column('online_status', TINYINT(1), nullable=False, server_default=text("'0'"), comment='离线状态 0：在线，1：离线'),
    Column('create_time', INTEGER(10), nullable=False, server_default=text("'0'"), comment='状态变更时间'),
    Column('update_time', INTEGER(10), nullable=False, server_default=text("'0'"), comment='修改时间'),
    Column('is_delete', TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除'),
    Column('delete_time', INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间')
)


t_intelligent_lock_open_log = Table(
    'intelligent_lock_open_log', metadata,
    Column('lock_id', INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='门锁ID'),
    Column('open_type', TINYINT(2), nullable=False, server_default=text("'3'"), comment='开门方式:0：未知,1：机械钥匙开门,2：密码开门,3：远程开门,4：指纹,5：刷卡开门,6：APP蓝牙开门,7：一次性密码开门,8：时效密码开门'),
    Column('password_uuid', String(8), nullable=False, server_default=text("'0'"), comment='密码编号'),
    Column('request_uuid', String(32), nullable=False, server_default=text("'0'"), comment='远程开锁请求与回调唯一关联字段（云柚例外，以同步为准）'),
    Column('auth_type', TINYINT(1), nullable=False, server_default=text("'1'"), comment='授权类型（1：租客 /2：员工 ）'),
    Column('auth_id', INTEGER(11), nullable=False, server_default=text("'0'"), comment='授权ID ( 租客ID / 管理员ID )'),
    Column('create_time', INTEGER(10), nullable=False, server_default=text("'0'"), comment='开门时间'),
    Column('update_time', INTEGER(10), nullable=False, server_default=text("'0'"), comment='修改时间'),
    Column('is_delete', TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除'),
    Column('delete_time', INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间')
)


t_intelligent_lock_password = Table(
    'intelligent_lock_password', metadata,
    Column('lock_id', INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='门锁ID'),
    Column('room_id', INTEGER(10), nullable=False, index=True, server_default=text("'0'"), comment='房间ID'),
    Column('house_id', INTEGER(10), nullable=False, index=True, server_default=text("'0'"), comment='大门ID'),
    Column('contract_id', INTEGER(11), nullable=False, server_default=text("'0'"), comment='合同ID'),
    Column('phone', String(32), nullable=False, comment='手机号'),
    Column('begin_time', INTEGER(11), nullable=False, server_default=text("'0'"), comment='密码开始时间'),
    Column('end_time', INTEGER(10), nullable=False, server_default=text("'0'"), comment='密码结束时间'),
    Column('frozen_status', TINYINT(1), nullable=False, server_default=text("'0'"), comment='密码冻结状态 0未冻结，1已冻结'),
    Column('auth_type', TINYINT(1), nullable=False, server_default=text("'1'"), comment='授权类型（1：租客 /2：员工 ）'),
    Column('auth_id', INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='授权ID ( 租客ID / 管理员ID )'),
    Column('password_uuid', String(8), nullable=False, server_default=text("'0'"), comment='密码编号'),
    Column('password_type', TINYINT(1), nullable=False, server_default=text("'1'"), comment='密码类型-1:普通密码，2:次数密码'),
    Column('password', LargeBinary, nullable=False, comment='密码'),
    Column('password_md5', String(32), nullable=False, server_default=text("''"), comment='密码'),
    Column('operator_employee_id', INTEGER(10), nullable=False, server_default=text("'0'"), comment='操作人ID'),
    Column('create_time', INTEGER(10), nullable=False, server_default=text("'0'"), comment='创建时间'),
    Column('update_time', INTEGER(10), nullable=False, server_default=text("'0'"), comment='更新时间'),
    Column('is_delete', TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除'),
    Column('delete_time', INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间'),
    Column('is_relation', TINYINT(1), nullable=False, server_default=text("'0'"))
)


class IntelligentLockStatu(Base):
    __tablename__ = 'intelligent_lock_status'

    intelligent_lock_status_id = Column(String(32, 'utf8mb4_unicode_ci'), primary_key=True, comment='锁状态表主键ID')
    lock_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='锁表的主键ID-外键')
    low_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否低电量：1否，2是')
    low_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='门锁变为低电量/恢复电量的实时时间，非数据库改变时间')
    update_low_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='厂商通知低电量/恢复电量，这个通知的时间')
    open_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='开门/关门的实时时间，非数据库修改时间')
    update_open_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='厂商通知开门/关门，这个通知的时间')
    open_type = Column(String(20, 'utf8mb4_unicode_ci'), nullable=False, server_default=text("''"), comment='开门类型：0：APP蓝牙开门 1：自定义密码开门 2：一次性密码开门 3：远程开门 4：时效密码开门 5：门禁卡开门 6：物理钥匙开门/内把手开门 8：关门 9：临时密码开门 10.网络自定义密码开门')
    off_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='门锁离线/上线的实时时间，非通知时间')
    update_off_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='门锁离线/上线，厂商给通知的时间')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='创建时间')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='删除状态：1正常，2已删除')


class IntelligentLockTest(Base):
    __tablename__ = 'intelligent_lock_test'

    lock_id = Column(INTEGER(11), primary_key=True, comment='主键ID')
    device_code = Column(String(30), nullable=False, server_default=text("''"), comment='设备编码全局唯一')
    apartment_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='门店ID')
    room_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='room_id')
    room_number = Column(String(20), nullable=False, server_default=text("''"), comment='房间编号')
    house_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='house_id')
    floor_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='楼层ID')
    ridgepole_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='楼栋ID')
    api_interface = Column(String(20), nullable=False, comment='接口')
    lock_code = Column(String(50), nullable=False, server_default=text("''"), comment='房源锁唯一标识')
    device_sn = Column(String(32), nullable=False, server_default=text("''"), comment='设备SN编号')
    device_uuid = Column(String(32), nullable=False, server_default=text("''"), comment='设备UUID')
    electric = Column(TINYINT(3), nullable=False, server_default=text("'0'"), comment='电量')
    online_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否离线 0：在线，1：离线')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='更新时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间')
    dd_room_id = Column(String(64), server_default=text("''"), comment='云丁房间编号')
    dd_home_id = Column(String(64), server_default=text("''"), comment='云丁房源编号')


t_intelligent_power_bee = Table(
    'intelligent_power_bee', metadata,
    Column('intelligent_power_bee_id', String(32), nullable=False, server_default=text("''"), comment='电表ID'),
    Column('room_id', INTEGER(11), nullable=False, server_default=text("'0'"), comment='房间ID'),
    Column('device_uuid', String(64), nullable=False, server_default=text("''"), comment='设备ID'),
    Column('hardware_version', String(50), nullable=False, server_default=text("''"), comment='硬件版本'),
    Column('system_version', String(50), nullable=False, server_default=text("''"), comment='当前嵌入式版本'),
    Column('create_time', INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间'),
    Column('update_time', INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间'),
    Column('delete_time', INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间'),
    Column('delete_status', INTEGER(11), nullable=False, server_default=text("'1'"), comment='删除状态'),
    Column('detail', String(255), nullable=False, server_default=text("''"), comment='详情')
)


class IntelligentWater(Base):
    __tablename__ = 'intelligent_water'

    water_id = Column(INTEGER(11), primary_key=True)
    device_code = Column(String(100), nullable=False, comment='智能设备device_code')
    api_interface = Column(String(50), nullable=False, server_default=text("''"), comment='接口')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    room_number = Column(String(20), nullable=False, server_default=text("''"), comment='房间编号')
    room_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='房间ID')
    account = Column(String(100), nullable=False, server_default=text("''"), comment='水表绑定账号')
    device_uuid = Column(String(100), nullable=False, server_default=text("''"), comment='设备uuid')
    gateway_code = Column(String(15), nullable=False, server_default=text("''"), comment='集中器编号')
    device_sn = Column(String(64), nullable=False, server_default=text("''"), comment='设备编号')
    price = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='目前单价')
    surplus = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='剩余水量')
    switch_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='开关状态 0-断电 1-通电')
    pay_mode = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='付费模式  0 预付 1后付')
    water_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='设备状态 1正常使用 2空置')
    online_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否在线(0-在线，1-离线)')
    syn_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='同步时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')


class IntelligentWaterApartmentConf(Base):
    __tablename__ = 'intelligent_water_apartment_conf'

    water_apartment_conf_id = Column(INTEGER(11), primary_key=True)
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    price = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='目前单价')
    pay_mode = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='付费模式  0 预付 1后付')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')


class IntelligentWaterOperatorLog(Base):
    __tablename__ = 'intelligent_water_operator_log'

    water_operator_log_id = Column(INTEGER(11), primary_key=True)
    water_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='智能水表主表ID')
    modify_field = Column(String(64), nullable=False, server_default=text("''"), comment='被修改的字段')
    before_modify_value = Column(String(64), nullable=False, server_default=text("''"), comment='修改前值')
    after_modify_value = Column(String(64), nullable=False, server_default=text("''"), comment='修改后值')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改人')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')


class IntelligentWaterRecharge(Base):
    __tablename__ = 'intelligent_water_recharge'

    water_recharge_id = Column(INTEGER(11), primary_key=True, comment='智能水费充值表id')
    water_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='智能水表主表ID')
    room_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='房间id')
    room_number = Column(String(20), nullable=False, server_default=text("''"), comment='房间号')
    apartment_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='门店id')
    tenant_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='租客ID')
    value = Column(String(10), nullable=False, server_default=text("'0'"), comment='充值水量')
    unit_price = Column(String(10), nullable=False, server_default=text("'0'"), comment='充值时单价')
    money = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='充值金额')
    status = Column(TINYINT(4), nullable=False, server_default=text("'0'"), comment='充值状态; 0：未成功; 1：成功 2：充值失败')
    pay_status = Column(TINYINT(4), nullable=False, server_default=text("'0'"), comment='支付状态 0未支付，1支付中，2取消支付，3支付失败，4支付成功,5支付金额错误')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    order_no = Column(String(200), nullable=False, server_default=text("''"), comment='[pms大order]对外提供的唯一订单号')


class IntelligentWaterSynchroInfo(Base):
    __tablename__ = 'intelligent_water_synchro_info'

    water_synchro_info_id = Column(INTEGER(11), primary_key=True)
    water_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='智能水表主表ID')
    synchro_url = Column(String(255), nullable=False, server_default=text("''"), comment='同步地址')
    synchro_param = Column(MEDIUMTEXT, nullable=False, comment='同步参数内容')
    synchro_return = Column(MEDIUMTEXT, nullable=False, comment='同步接口结果返回')
    synchro_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='同步状态（0：未同步，1：同步成功，2：同步失败）')
    synchro_count = Column(TINYINT(2), nullable=False, server_default=text("'0'"), comment='同步次数')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class InterceptConfig(Base):
    __tablename__ = 'intercept_config'

    intercept_config_id = Column(String(32), primary_key=True, unique=True)
    apartment_id = Column(BIGINT(20), comment='门店ID')
    begin_time = Column(INTEGER(10), comment='截留开始时间')
    merchant_id = Column(String(32), comment='商户ID')
    account_type = Column(String(100), comment='账户类型:公共public,门店apartment')
    merchant_type = Column(TINYINT(1), server_default=text("'1'"), comment='商户号类型：1:个人 2:企业')
    merchant_name = Column(String(32), comment='商户别名')
    bank_name = Column(String(100), comment='银行名称')
    card_no = Column(String(32), comment='银行卡号MD5')
    create_time = Column(INTEGER(10), server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(10), server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(10), server_default=text("'0'"))
    delete_status = Column(TINYINT(1), server_default=text("'1'"), comment='1正常，2删除')
    operator_id = Column(String(32), comment='操作员工id')
    config_state = Column(TINYINT(1), comment='截留配置状态(1 打开 2 关闭)')


class InterceptConfigSubject(Base):
    __tablename__ = 'intercept_config_subject'

    intercept_config_subject_id = Column(String(32), primary_key=True, unique=True)
    intercept_config_id = Column(String(32), comment='截留配置ID')
    subject_info_id = Column(String(32), comment='科目id')
    subject_info = Column(String(32), comment='科目名称')
    intercept_amount = Column(DECIMAL(10, 2), comment='截留金额')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='1正常，2删除')
    operator_id = Column(String(32), comment='操作员工id')


class InterceptRecord(Base):
    __tablename__ = 'intercept_record'

    intercept_record_id = Column(String(32), primary_key=True, unique=True, comment='截留记录主键id')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店id')
    intercept_config_id = Column(String(32), nullable=False, server_default=text("''"), comment='截留配置id')
    intercept_status = Column(INTEGER(2), nullable=False, server_default=text("'1'"), comment='截留状态：1截留中，2截留完成，3已关闭（手动）')
    intercept_subject_id = Column(String(100), nullable=False, server_default=text("''"), comment='截留科目id逗号拼接，直接从截留配置中读取拼接')
    intercept_subject_name = Column(String(100), nullable=False, server_default=text("''"), comment='截留科目名称逗号拼接，直接从截留配置中读取拼接')
    intercept_amount = Column(DECIMAL(20, 4), nullable=False, server_default=text("'0.0000'"), comment='应截留总额')
    intercepted_amount = Column(DECIMAL(20, 4), nullable=False, server_default=text("'0.0000'"), comment='已截留金额')
    start_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='截留开始时间（读取配置的开始时间）')
    end_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='截留结束时间（写入截留完成或手动关闭的时间）')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    create_person = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建人（一般这里都是0）')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    close_person = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='手动关闭人id')
    delete_status = Column(INTEGER(2), nullable=False, server_default=text("'1'"), comment='1正常，2删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间')


class InterceptRecordDetail(Base):
    __tablename__ = 'intercept_record_detail'

    intercept_record_detail_id = Column(String(32), primary_key=True, unique=True, comment='截留记录明细主键id')
    intercept_record_id = Column(String(32), nullable=False, server_default=text("''"), comment='截留记录主表id')
    bill_id = Column(String(32), nullable=False, server_default=text("''"), comment='账单id')
    out_trade_no = Column(String(32), nullable=False, server_default=text("''"), comment='支付id')
    source_subject_id = Column(String(100), nullable=False, server_default=text("''"), comment='此次截留的来源科目id逗号拼接')
    subject_id = Column(String(50), nullable=False, server_default=text("''"), comment='此次截留的科目id（一条明细只能有一个科目，若一次截留多条数据，则分为多条明细）')
    detail_amount = Column(DECIMAL(20, 2), nullable=False, server_default=text("'0.00'"), comment='此次截留金额')
    delete_status = Column(INTEGER(2), nullable=False, server_default=text("'1'"), comment='1正常，2删除')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))


class InterpersonalRelationConfiguration(Base):
    __tablename__ = 'interpersonal_relation_configuration'

    interpersonal_relation_configuration_id = Column(INTEGER(11), primary_key=True, comment='人际关系id')
    interpersonal_relation_name = Column(String(64), nullable=False, server_default=text("' '"), comment='人际关系名称')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='更新时间')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')


class LatePaymentFeeConfig(Base):
    __tablename__ = 'late_payment_fee_config'

    id = Column(INTEGER(11), primary_key=True, comment='滞纳金自增ID')
    late_payment_fee_config_id = Column(String(32), nullable=False, index=True, server_default=text("''"), comment='滞纳金配置ID')
    late_payment_fee_group_id = Column(String(32), nullable=False, index=True, server_default=text("''"), comment='滞纳金组ID')
    late_payment_fee_type = Column(TINYINT(4), nullable=False, server_default=text("'0'"), comment='滞纳金类型; 1: 合同账单; 2: 乐乎分期; 3: 门店分期')
    advance_day = Column(TINYINT(4), nullable=False, server_default=text("'0'"), comment='提前天数')
    charging_type = Column(TINYINT(4), nullable=False, server_default=text("'0'"), comment='计费类型; 1: 固定金额; 2: 租金比例')
    charging_type_val = Column(DECIMAL(6, 2), nullable=False, server_default=text("'0.00'"), comment='计费类型值; 固定金额: 元/天; 租金比例: %')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作者ID')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='删除状态; 1:未删除, 2:已删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class LatePaymentFeeGroup(Base):
    __tablename__ = 'late_payment_fee_group'

    id = Column(INTEGER(11), primary_key=True, comment='滞纳金分组自增ID')
    late_payment_fee_group_id = Column(String(32), nullable=False, index=True, server_default=text("''"), comment='滞纳金分组ID')
    scheme_title = Column(String(100), nullable=False, server_default=text("''"), comment='配置方案标题')
    scheme_status = Column(TINYINT(1), comment='方案状态(1 正常 2 已作废)')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作者ID')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='删除状态; 1:未删除, 2:已删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class LatePaymentFeeGroupApartmentRelation(Base):
    __tablename__ = 'late_payment_fee_group_apartment_relation'

    id = Column(INTEGER(11), primary_key=True, comment='关系表自增ID')
    apartment_late_payment_fee_relation_id = Column(String(32), nullable=False, server_default=text("''"), comment='关系ID')
    late_payment_fee_group_id = Column(String(32), nullable=False, index=True, server_default=text("''"), comment='滞纳金分组ID')
    apartment_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='门店ID')
    city_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='城市ID')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='删除状态; 1:未删除, 2:已删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class LatePaymentFeeGroupContractRelation(Base):
    __tablename__ = 'late_payment_fee_group_contract_relation'

    id = Column(INTEGER(11), primary_key=True, comment='关系表自增ID')
    contract_late_payment_fee_relation_id = Column(String(32), nullable=False, server_default=text("''"), comment='关系ID')
    late_payment_fee_group_id = Column(String(32), nullable=False, index=True, server_default=text("''"), comment='滞纳金分组ID')
    contract_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='合同ID')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='删除状态; 1:未删除, 2:已删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class Lekatv(Base):
    __tablename__ = 'lekatv'

    tv_id = Column(INTEGER(11), primary_key=True)
    title = Column(String(255), nullable=False, server_default=text("''"), comment='标题')
    video_url = Column(String(255), nullable=False, server_default=text("''"), comment='视频地址')
    order = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='排序')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class Lessor(Base):
    __tablename__ = 'lessor'

    lessor_id = Column(String(32), primary_key=True, comment='主键')
    apartment_id = Column(String(32), index=True, comment='门店ID')
    room_id = Column(INTEGER(11), comment='房间ID')
    region = Column(String(6), nullable=False, server_default=text("'420100'"), comment='行政区划代码 武汉市  420100')
    file_head = Column(String(50), server_default=text("'HP'"), comment='上传文件地址头')
    Certificate_type = Column(String(2), nullable=False, server_default=text("'01'"), comment='产权证类型  01 房屋所有权证\\r02 不动产权证\\r03 商品房合同\\r99 其他')
    Certificate = Column(String(255), nullable=False, server_default=text("''"), comment='产权证编号')
    lessor_name = Column(String(32), nullable=False, server_default=text("''"), comment='门店出租人')
    id_type = Column(String(2), nullable=False, server_default=text("'01'"), comment='证件类型,01 身份证;02 港澳台身份证;03 护照;04 户口簿;05 军官证(士兵证);06 组织机构代码;07 营业执照;08 统一社会信用代码;99 其他')
    id_card = Column(String(32), nullable=False, server_default=text("''"), comment='证件号码')
    lessor_phone = Column(String(32), nullable=False, server_default=text("''"), comment='出租人电话')
    lessor_address = Column(String(32), nullable=False, server_default=text("''"), comment='出租人住所')
    sign_hym = Column(String(50), comment='核验码')
    node_id = Column(String(6), server_default=text("'HBWHMA'"), comment='节点code')
    node_no = Column(String(255), server_default=text("'420100MA'"), comment='节点编码')
    is_delete = Column(INTEGER(1), server_default=text("'0'"), comment='是否删除')


class LisaClientHotUpdatePack(Base):
    __tablename__ = 'lisa_client_hot_update_pack'

    lisa_client_hot_update_pack_id = Column(INTEGER(11), primary_key=True, comment='lisa客户端热更新包管理表id')
    pack_name = Column(String(20), nullable=False, server_default=text("''"), comment='升级包名称')
    app_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='客户端id')
    update_version = Column(String(20), nullable=False, comment='更新包版本')
    download_url = Column(String(255), nullable=False, server_default=text("''"), comment='JS包下载地址')
    release_state = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='发布状态 0 未发布 1 发布')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class MarketingCoupon(Base):
    __tablename__ = 'marketing_coupon'

    coupon_id = Column(String(32), primary_key=True, comment='优惠券实体主键ID')
    coupon_template_id = Column(String(32), nullable=False, server_default=text("''"), comment='优惠券模板id，为0则说明是2019年1月前的老数据修过来的，为空串则说明是lisa中直接为员工添加的优惠券')
    coupon_package_id = Column(String(32), nullable=False, server_default=text("''"), comment='优惠券包ID，可为空')
    coupon_code = Column(String(100), nullable=False, server_default=text("''"), comment='优惠券code，13位时间戳+4位随机数+coupon')
    tenant_id = Column(String(32), nullable=False, server_default=text("''"), comment='租客ID')
    phone = Column(String(50), nullable=False, server_default=text("''"), comment='租客手机')
    apartment_id = Column(String(2048), nullable=False, server_default=text("''"), comment='可用门店ID逗号拼接，为空串则所有门店都可用')
    send_apartment = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='发放此优惠券的门店')
    send_employee = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='发放此优惠券的员工id')
    start_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='有效期：开始时间')
    end_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='有效期：结束时间')
    discard_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否废弃：1正常，2已废弃')
    discard_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='作废时间')
    discard_employee = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='作废人')
    use_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否使用：1正常，2已使用')
    use_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='使用时间')
    use_apartment = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='使用门店id')
    use_intro = Column(String(500), nullable=False, server_default=text("''"), comment='使用描述')
    lock_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否锁定：1未锁定，2已锁定')
    lock_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='锁定时间')
    unlock_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='解锁时间')
    lock_code = Column(String(64), nullable=False, server_default=text("''"), comment='锁定码：优惠券锁定的时候生成的锁定码，用于解锁或最终使用。生成规则：32位UUID+lock')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='生成时间')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='如果back_status=2为扣回状态，那么updatetime就是扣回时间')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='1正常，2删除')
    operator_employee_id = Column(String(32), nullable=False, server_default=text("''"), comment='操作员工id，为空串则说明是非工作人员操作而是租客自己在客户端领取')
    coupon_template_name = Column(String(255), nullable=False, server_default=text("''"), comment='优惠模板名称')
    remark = Column(String(1000), nullable=False, server_default=text("''"), comment='优惠模板备注，即使用说明')
    scene_code = Column(String(500), nullable=False, server_default=text("''"), comment='使用条件：唯一的场景code')
    scene_name = Column(String(500), nullable=False, server_default=text("''"), comment='场景名称')
    subject_number = Column(String(500), nullable=False, server_default=text("''"), comment='使用条件：唯一的科目ID')
    subject_name = Column(String(500), nullable=False, server_default=text("''"), comment='科目名称')
    use_range = Column(INTEGER(2), nullable=False, server_default=text("'0'"), comment='0任意期次，1首月，2账单周期')
    contract_cycle = Column(String(255), nullable=False, server_default=text("''"), comment='使用条件：合同周期1，2，3，4...12，24（逗号拼接）')
    discount_form = Column(String(10), nullable=False, server_default=text("''"), comment='优惠形式：无门槛：00金额 or 01打折，满减：10金额 or 11打折，阶梯满减：20金额 or 21打折')
    reach_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='需要满足的金额：当优惠形式为非0开头的，此字段有值')
    discount_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='优惠金额（优惠形式为00 10 20 时此字段有值）')
    discount_ratio = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='优惠折扣比例（优惠形式为01 11 21 时此字段有值），值为0-10之间')
    real_discount_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='若状态为已锁定或已使用，则为实际优惠金额')
    back_mode = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='扣回方式（0：不扣，1：全额，2：按月，3：按天）')
    back_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否扣回：1否，2是')
    back_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='若状态为已扣回，则为实际扣回金额')
    use_channel_code = Column(String(500), nullable=False, server_default=text("''"), comment='使用渠道CODE逗号拼接')
    vip_card_number = Column(String(32), server_default=text("''"), comment='会员卡编号/ID')
    create_person = Column(INTEGER(10), server_default=text("'0'"), comment='创建人id-员工')
    send_platform = Column(INTEGER(2), nullable=False, server_default=text("'1'"), comment='发放平台、来源：1-lisa中台，2-lisa前台')
    coupon_type = Column(INTEGER(2), nullable=False, server_default=text("'0'"), comment='优惠类型：1-代金券，2-折扣券')
    coupon_template_type = Column(TINYINT(1), nullable=False, server_default=text("'2'"), comment='发放方式：1用户主动领取，2系统自动发放')
    use_limit = Column(INTEGER(2), nullable=False, server_default=text("'0'"), comment='使用门槛 0:无门槛 1:押付方式 2:合同周期 3:新会员首单')
    use_pay_way = Column(INTEGER(2), nullable=False, server_default=text("'0'"), comment='使用门槛的押付方式：0后面的全部，1押一付一，2押二付一，3押一付三')


class MarketingCouponChannel(Base):
    __tablename__ = 'marketing_coupon_channel'

    coupon_channel_code = Column(String(50), primary_key=True, comment='发放渠道主键CODE')
    coupon_channel_name = Column(String(50), nullable=False, server_default=text("''"), comment='渠道名称')
    remark = Column(String(500), nullable=False, server_default=text("''"), comment='备注描述')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='1正常，2删除')


class MarketingCouponCopy(Base):
    __tablename__ = 'marketing_coupon_copy'

    coupon_id = Column(String(32), primary_key=True, comment='优惠券实体主键ID')
    coupon_template_id = Column(String(32), nullable=False, server_default=text("''"), comment='优惠券模板id，为0则说明是2019年1月前的老数据修过来的，为空串则说明是lisa中直接为员工添加的优惠券')
    coupon_package_id = Column(String(32), nullable=False, server_default=text("''"), comment='优惠券包ID，可为空')
    coupon_code = Column(String(100), nullable=False, server_default=text("''"), comment='优惠券code，13位时间戳+4位随机数+coupon')
    tenant_id = Column(String(32), nullable=False, server_default=text("''"), comment='租客ID')
    phone = Column(String(50), nullable=False, server_default=text("''"), comment='租客手机')
    apartment_id = Column(String(1000), nullable=False, server_default=text("''"), comment='可用门店ID逗号拼接，为空串则所有门店都可用')
    send_apartment = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='发放此优惠券的门店')
    send_employee = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='发放此优惠券的员工id')
    start_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='有效期：开始时间')
    end_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='有效期：结束时间')
    discard_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否废弃：1正常，2已废弃')
    discard_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='作废时间')
    discard_employee = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='作废人')
    use_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否使用：1正常，2已使用')
    use_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='使用时间')
    use_apartment = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='使用门店id')
    use_intro = Column(String(500), nullable=False, server_default=text("''"), comment='使用描述')
    lock_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否锁定：1未锁定，2已锁定')
    lock_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='锁定时间')
    unlock_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='解锁时间')
    lock_code = Column(String(64), nullable=False, server_default=text("''"), comment='锁定码：优惠券锁定的时候生成的锁定码，用于解锁或最终使用。生成规则：32位UUID+lock')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='生成时间')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='如果back_status=2为扣回状态，那么updatetime就是扣回时间')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='1正常，2删除')
    operator_employee_id = Column(String(32), nullable=False, server_default=text("''"), comment='操作员工id，为空串则说明是非工作人员操作而是租客自己在客户端领取')
    coupon_template_name = Column(String(255), nullable=False, server_default=text("''"), comment='优惠模板名称')
    remark = Column(String(1000), nullable=False, server_default=text("''"), comment='优惠模板备注，即使用说明')
    scene_code = Column(String(500), nullable=False, server_default=text("''"), comment='使用条件：唯一的场景code')
    scene_name = Column(String(500), nullable=False, server_default=text("''"), comment='场景名称')
    subject_number = Column(String(500), nullable=False, server_default=text("''"), comment='使用条件：唯一的科目ID')
    subject_name = Column(String(500), nullable=False, server_default=text("''"), comment='科目名称')
    contract_cycle = Column(String(255), nullable=False, server_default=text("''"), comment='使用条件：合同周期1，2，3，4...12，24（逗号拼接）')
    discount_form = Column(String(10), nullable=False, server_default=text("''"), comment='优惠形式：无门槛：00金额 or 01打折，满减：10金额 or 11打折，阶梯满减：20金额 or 21打折')
    reach_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='需要满足的金额：当优惠形式为非0开头的，此字段有值')
    discount_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='优惠金额（优惠形式为00 10 20 时此字段有值）')
    discount_ratio = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='优惠折扣比例（优惠形式为01 11 21 时此字段有值），值为0-10之间')
    real_discount_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='若状态为已锁定或已使用，则为实际优惠金额')
    back_mode = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='扣回方式（0：不扣，1：全额，2：按月，3：按天）')
    back_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否扣回：1否，2是')
    back_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='若状态为已扣回，则为实际扣回金额')
    use_channel_code = Column(String(500), nullable=False, server_default=text("''"), comment='使用渠道CODE逗号拼接')
    vip_card_number = Column(String(32), server_default=text("''"), comment='会员卡编号/ID')
    create_person = Column(INTEGER(11), server_default=text("'0'"), comment='创建人')
    send_platform = Column(INTEGER(2), nullable=False, server_default=text("'1'"), comment='发放平台、来源：1-lisa中台，2-lisa前台')
    coupon_type = Column(INTEGER(2), nullable=False, server_default=text("'0'"), comment='优惠类型：1-代金券')
    coupon_template_type = Column(TINYINT(1), nullable=False, server_default=text("'2'"), comment='领取方式：1用户主动领取，2系统自动发放')


class MarketingCouponCopy2(Base):
    __tablename__ = 'marketing_coupon_copy2'

    coupon_id = Column(String(32), primary_key=True, comment='优惠券实体主键ID')
    coupon_template_id = Column(String(32), nullable=False, server_default=text("''"), comment='优惠券模板id，为0则说明是2019年1月前的老数据修过来的，为空串则说明是lisa中直接为员工添加的优惠券')
    coupon_package_id = Column(String(32), nullable=False, server_default=text("''"), comment='优惠券包ID，可为空')
    coupon_code = Column(String(100), nullable=False, server_default=text("''"), comment='优惠券code，13位时间戳+4位随机数+coupon')
    tenant_id = Column(String(32), nullable=False, server_default=text("''"), comment='租客ID')
    phone = Column(String(50), nullable=False, server_default=text("''"), comment='租客手机')
    apartment_id = Column(String(1000), nullable=False, server_default=text("''"), comment='可用门店ID逗号拼接，为空串则所有门店都可用')
    send_apartment = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='发放此优惠券的门店')
    send_employee = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='发放此优惠券的员工id')
    start_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='有效期：开始时间')
    end_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='有效期：结束时间')
    discard_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否废弃：1正常，2已废弃')
    discard_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='作废时间')
    discard_employee = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='作废人')
    use_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否使用：1正常，2已使用')
    use_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='使用时间')
    use_apartment = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='使用门店id')
    use_intro = Column(String(500), nullable=False, server_default=text("''"), comment='使用描述')
    lock_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否锁定：1未锁定，2已锁定')
    lock_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='锁定时间')
    unlock_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='解锁时间')
    lock_code = Column(String(64), nullable=False, server_default=text("''"), comment='锁定码：优惠券锁定的时候生成的锁定码，用于解锁或最终使用。生成规则：32位UUID+lock')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='生成时间')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='如果back_status=2为扣回状态，那么updatetime就是扣回时间')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='1正常，2删除')
    operator_employee_id = Column(String(32), nullable=False, server_default=text("''"), comment='操作员工id，为空串则说明是非工作人员操作而是租客自己在客户端领取')
    coupon_template_name = Column(String(255), nullable=False, server_default=text("''"), comment='优惠模板名称')
    remark = Column(String(1000), nullable=False, server_default=text("''"), comment='优惠模板备注，即使用说明')
    scene_code = Column(String(500), nullable=False, server_default=text("''"), comment='使用条件：唯一的场景code')
    scene_name = Column(String(500), nullable=False, server_default=text("''"), comment='场景名称')
    subject_number = Column(String(500), nullable=False, server_default=text("''"), comment='使用条件：唯一的科目ID')
    subject_name = Column(String(500), nullable=False, server_default=text("''"), comment='科目名称')
    use_range = Column(INTEGER(2), nullable=False, server_default=text("'0'"), comment='0任意期次，1首月，2账单周期')
    contract_cycle = Column(String(255), nullable=False, server_default=text("''"), comment='使用条件：合同周期1，2，3，4...12，24（逗号拼接）')
    discount_form = Column(String(10), nullable=False, server_default=text("''"), comment='优惠形式：无门槛：00金额 or 01打折，满减：10金额 or 11打折，阶梯满减：20金额 or 21打折')
    reach_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='需要满足的金额：当优惠形式为非0开头的，此字段有值')
    discount_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='优惠金额（优惠形式为00 10 20 时此字段有值）')
    discount_ratio = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='优惠折扣比例（优惠形式为01 11 21 时此字段有值），值为0-10之间')
    real_discount_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='若状态为已锁定或已使用，则为实际优惠金额')
    back_mode = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='扣回方式（0：不扣，1：全额，2：按月，3：按天）')
    back_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否扣回：1否，2是')
    back_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='若状态为已扣回，则为实际扣回金额')
    use_channel_code = Column(String(500), nullable=False, server_default=text("''"), comment='使用渠道CODE逗号拼接')
    vip_card_number = Column(String(32), server_default=text("''"), comment='会员卡编号/ID')
    create_person = Column(INTEGER(10), server_default=text("'0'"), comment='创建人id-员工')
    send_platform = Column(INTEGER(2), nullable=False, server_default=text("'1'"), comment='发放平台、来源：1-lisa中台，2-lisa前台')
    coupon_type = Column(INTEGER(2), nullable=False, server_default=text("'0'"), comment='优惠类型：1-代金券')
    coupon_template_type = Column(TINYINT(1), nullable=False, server_default=text("'2'"), comment='发放方式：1用户主动领取，2系统自动发放')


class MarketingCouponPackage(Base):
    __tablename__ = 'marketing_coupon_package'

    coupon_package_id = Column(String(32), primary_key=True, comment='优惠券包主键ID')
    coupon_template_id = Column(String(32), nullable=False, server_default=text("''"), comment='优惠券模板id，为0则说明是2019年1月前的老数据修过来的，为空串则说明是lisa中直接为员工添加的优惠券')
    tenant_id = Column(String(32), nullable=False, server_default=text("''"), comment='租客id')
    coupon_number = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='包含的优惠券数量')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='生成时间')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='1正常，2删除')
    operator_employee_id = Column(String(32), nullable=False, server_default=text("''"), comment='操作员工id，为空串则说明是非工作人员操作而是租客自己在客户端领取')


class MarketingCouponRule(Base):
    __tablename__ = 'marketing_coupon_rule'

    coupon_rule_id = Column(String(32), primary_key=True, comment='优惠规则主键ID')
    coupon_template_id = Column(String(32), nullable=False, server_default=text("''"), comment='优惠模板ID')
    scene_code = Column(String(500), nullable=False, server_default=text("''"), comment='使用条件：唯一的场景CODE')
    scene_name = Column(String(500), nullable=False, server_default=text("''"), comment='场景名称')
    subject_number = Column(String(500), nullable=False, server_default=text("''"), comment='使用条件：唯一的科目ID')
    subject_name = Column(String(500), nullable=False, comment='科目名称')
    use_range = Column(INTEGER(2), nullable=False, server_default=text("'0'"), comment='0任意期次，1首月，2账单周期')
    contract_cycle = Column(String(255), nullable=False, server_default=text("''"), comment='发放条件：合同周期1，2，3，4...12，24（逗号拼接）')
    receiver_type = Column(INTEGER(2), nullable=False, server_default=text("'1'"), comment='（领取）领取人类型：0所有用户，1会员用户，2非会员用户，3用户组')
    user_group_id = Column(String(50), nullable=False, server_default=text("''"), comment='（领取）用户组id逗号拼接，如果receiverType领取人类型为3用户组时，restrictTenantStatus领取人设置必传01无限制')
    restrict_tenant_status = Column(String(10), nullable=False, server_default=text("''"), comment='（领取）领取人设置：01无限制，02新注册用户，03会员卡购买时间，04会员卡等级，05直签，06预定，07老用户，08合同周期，09续租意向客户')
    tenant_starttime = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='当限制用户为02新注册用户时，为注册开始时间；当限制为03时，为购买会员卡开始时间；当领取人设置为05时，为入住开始时间；当领取人设置为06时，为预定开始时间；')
    tenant_endtime = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='当限制用户为02新注册用户时，为注册结束时间；当限制为03时，为购买会员卡结束时间；当领取人设置为05时，为入住截止时间；当领取人设置为06时，为截止开始时间；')
    pay_way = Column(INTEGER(2), nullable=False, server_default=text("'0'"), comment='押付方式：0后面的全部，1押一付一，2押二付一，3押一付三')
    vip_grade = Column(INTEGER(2), nullable=False, server_default=text("'0'"), comment='会员等级：0全部，1青年会员，2金牌会员，3铂金会员，4钻石会员，5星耀会员')
    apartment_id = Column(String(1000), nullable=False, server_default=text("''"), comment='（领取）可领取的门店id：逗号拼接。空串则表示所有门店都可以领取')
    cost_from = Column(INTEGER(1), nullable=False, server_default=text("'0'"), comment='费用承担方：1乐乎，2甲方')
    apartment_limit_status = Column(INTEGER(2), nullable=False, server_default=text("'1'"), comment='门店限制：1关闭，2开启（关闭时可用门店为空串，开启时可用门店必须有值）')
    use_apartment_id = Column(String(2048), nullable=False, server_default=text("''"), comment='使用条件：可用门店逗号拼接，空串表示所有门店可用')
    discount_form = Column(String(50), nullable=False, server_default=text("''"), comment='优惠形式：无门槛：00金额 or 01打折，满减：10金额 or 11打折，阶梯满减：20金额 or 21打折')
    city_id = Column(String(500), nullable=False, server_default=text("''"), comment='城市id：为空串或空则为非指定城市所有门店可用，不为空或空串则为指定城市id的所有门店可用；可有多个城市id逗号拼接')
    reach_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='需要满足的金额：当优惠形式为非0开头的，此字段有值')
    discount_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='优惠金额（优惠形式为00 10 20 时此字段有值）')
    discount_ratio = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='优惠折扣比例（优惠形式为01 11 21 时此字段有值），值为0-10之间')
    back_mode = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='扣回方式（0：不扣，1：全额，2：按月，3：按天）')
    use_limit = Column(INTEGER(2), nullable=False, server_default=text("'0'"), comment='使用门槛 0:无门槛 1:押付方式 2:合同周期 3:新会员首单')
    use_pay_way = Column(INTEGER(2), nullable=False, server_default=text("'0'"), comment='使用门槛的押付方式：0后面的全部，1押一付一，2押二付一，3押一付三')
    use_contract_cycle = Column(String(255), nullable=False, server_default=text("''"), comment='使用门槛的合同周期如1-6（-拼接）')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    delete_status = Column(INTEGER(10), nullable=False, server_default=text("'1'"), comment='1-正常，2删除')
    operator_employee_id = Column(String(32), nullable=False, server_default=text("''"), comment='操作员工ID')


class MarketingCouponRuleCopy(Base):
    __tablename__ = 'marketing_coupon_rule_copy'

    coupon_rule_id = Column(String(32), primary_key=True, comment='优惠规则主键ID')
    coupon_template_id = Column(String(32), nullable=False, server_default=text("''"), comment='优惠模板ID')
    scene_code = Column(String(500), nullable=False, server_default=text("''"), comment='使用条件：唯一的场景CODE')
    scene_name = Column(String(500), nullable=False, server_default=text("''"), comment='场景名称')
    subject_number = Column(String(500), nullable=False, server_default=text("''"), comment='使用条件：唯一的科目ID')
    subject_name = Column(String(500), nullable=False, comment='科目名称')
    contract_cycle = Column(String(255), nullable=False, server_default=text("''"), comment='使用条件：合同周期1，2，3，4...12，24（逗号拼接）')
    restrict_tenant_status = Column(String(10), nullable=False, server_default=text("''"), comment='（领取）是否限制用户：01无限制，02新注册用户，03购买会员卡')
    tenant_starttime = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='当限制用户为02新注册用户时，为注册开始时间；当限制为03时，为购买会员卡开始时间')
    tenant_endtime = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='当限制用户为02新注册用户时，为注册结束时间；当限制为03时，为购买会员卡结束时间')
    apartment_id = Column(String(1000), nullable=False, server_default=text("''"), comment='（领取）可领取的门店id：逗号拼接。空串则表示所有门店都可以领取')
    cost_from = Column(INTEGER(1), nullable=False, server_default=text("'0'"), comment='费用承担方：1乐乎，2甲方')
    use_apartment_id = Column(String(1000), nullable=False, server_default=text("''"), comment='使用条件：可用门店逗号拼接，空串表示所有门店可用')
    discount_form = Column(String(10), nullable=False, server_default=text("''"), comment='优惠形式：无门槛：00金额 or 01打折，满减：10金额 or 11打折，阶梯满减：20金额 or 21打折')
    reach_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='需要满足的金额：当优惠形式为非0开头的，此字段有值')
    discount_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='优惠金额（优惠形式为00 10 20 时此字段有值）')
    discount_ratio = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='优惠折扣比例（优惠形式为01 11 21 时此字段有值），值为0-10之间')
    back_mode = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='扣回方式（0：不扣，1：全额，2：按月，3：按天）')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    delete_status = Column(INTEGER(10), nullable=False, server_default=text("'1'"), comment='1-正常，2删除')
    operator_employee_id = Column(String(32), nullable=False, server_default=text("''"), comment='操作员工ID')


class MarketingCouponTemplate(Base):
    __tablename__ = 'marketing_coupon_template'

    coupon_template_id = Column(String(32), primary_key=True, comment='优惠模板主键ID')
    coupon_template_name = Column(String(255), nullable=False, server_default=text("''"), comment='优惠模板名称，即优惠券名称')
    coupon_template_type = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='领取方式：1用户主动领取，2官方发放（系统自动发放）')
    coupon_type = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='优惠类型：1-代金券，2-折扣券')
    coupon_tag = Column(String(255), nullable=False, server_default=text("''"), comment='优惠券标签')
    can_create_number = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='可生成总数')
    grant_start_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='[此字段停用]发放开始时间')
    grant_end_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='[此字段停用]发放结束时间')
    coupon_channel_code = Column(String(500), nullable=False, server_default=text("''"), comment='发放渠道CODE，逗号拼接')
    use_channel_code = Column(String(500), nullable=False, server_default=text("''"), comment='使用渠道CODE，逗号拼接')
    tenant_limit_number = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='租客限制领取张数：0无限制，大于0为具体限制数量')
    validity_type = Column(String(20), nullable=False, server_default=text("''"), comment='有效期类型：01固定效期类型，02领取当日开始计算效期类型，03领取次日开始计算效期类型')
    fixed_start_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='validity_type=01,固定效期开始时间')
    fixed_end_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='validity_type=01,固定效期结束时间')
    current_validity_days = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='validity_type=02,领到券当日开始N天内有效')
    next_validity_days = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='validity_type=03,有效期（互斥）：领导券次日开始N天内有效')
    remark = Column(String(1000), nullable=False, server_default=text("''"), comment='备注，使用说明')
    granted_number = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='已经发放的数量，即已经被用户领取的数量')
    send_platform = Column(INTEGER(2), nullable=False, server_default=text("'1'"), comment='发放平台、来源：1-lisa中台')
    upper_status = Column(INTEGER(2), nullable=False, server_default=text("'0'"), comment='上架状态：1新增，2上架，3下架')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='1正常，2删除')
    operator_employee_id = Column(String(32), nullable=False, server_default=text("''"), comment='操作员工id')
    create_person = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建人，发放人')


class MarketingCouponTemplateCopy(Base):
    __tablename__ = 'marketing_coupon_template_copy'

    coupon_template_id = Column(String(32), primary_key=True, comment='优惠模板主键ID')
    coupon_template_name = Column(String(255), nullable=False, server_default=text("''"), comment='优惠模板名称，即优惠券名称')
    coupon_template_type = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='领取方式：1用户主动领取，2官方发放（系统自动发放）')
    coupon_type = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='优惠类型：1-代金券。')
    coupon_tag = Column(String(255), nullable=False, server_default=text("''"), comment='优惠券标签')
    can_create_number = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='可生成总数')
    grant_start_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='[此字段停用]发放开始时间')
    grant_end_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='[此字段停用]发放结束时间')
    coupon_channel_code = Column(String(500), nullable=False, server_default=text("''"), comment='发放渠道CODE，逗号拼接')
    use_channel_code = Column(String(500), nullable=False, server_default=text("''"), comment='使用渠道CODE，逗号拼接')
    tenant_limit_number = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='租客限制领取张数：0无限制，大于0为具体限制数量')
    validity_type = Column(String(20), nullable=False, server_default=text("''"), comment='有效期类型：01固定效期类型，02领取当日开始计算效期类型，03领取次日开始计算效期类型')
    fixed_start_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='validity_type=01,固定效期开始时间')
    fixed_end_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='validity_type=01,固定效期结束时间')
    current_validity_days = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='validity_type=02,领到券当日开始N天内有效')
    next_validity_days = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='validity_type=03,有效期（互斥）：领导券次日开始N天内有效')
    remark = Column(String(1000), nullable=False, server_default=text("''"), comment='备注，使用说明')
    granted_number = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='已经发放的数量，即已经被用户领取的数量')
    send_platform = Column(INTEGER(2), nullable=False, server_default=text("'1'"), comment='发放平台、来源：1-lisa中台')
    upper_status = Column(INTEGER(2), nullable=False, server_default=text("'0'"), comment='上架状态：1新增，2上架，3下架')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='1正常，2删除')
    operator_employee_id = Column(String(32), nullable=False, server_default=text("''"), comment='操作员工id')
    create_person = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建人，发放人')


class MiddleEmployeeApartmentRelation(Base):
    __tablename__ = 'middle_employee_apartment_relation'

    middle_employee_apartment_relation_id = Column(String(32), primary_key=True)
    middle_permission_role_id = Column(String(32), nullable=False, comment='中台角色ID')
    employee_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='员工ID')
    is_see = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否驻入1是0否')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class MiddleEmployeeCityRelation(Base):
    __tablename__ = 'middle_employee_city_relation'

    middle_employee_city_relation_id = Column(String(32), primary_key=True)
    middle_permission_role_id = Column(String(32), nullable=False, comment='中台角色ID')
    employee_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='员工ID')
    is_see = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否驻入1是0否')
    city_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='城市ID')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class MiddleEmployeePermissionRole(Base):
    __tablename__ = 'middle_employee_permission_role'

    middle_employee_permission_role_id = Column(String(32), primary_key=True)
    middle_permission_role_id = Column(String(32), nullable=False, server_default=text("''"), comment='角色主键')
    employee_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'1'"), comment='用户主键')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class MiddlePermissionAcces(Base):
    __tablename__ = 'middle_permission_access'
    __table_args__ = (
        Index('table_id_name', 'table_name', 'table_resource_id'),
    )

    middle_permission_access_id = Column(String(32), primary_key=True)
    access = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='权限(0:未授权;1授权)')
    middle_permission_role_id = Column(String(32), nullable=False, index=True, comment='中台角色ID')
    employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='员工ID')
    permission_module_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='模块ID')
    table_name = Column(String(100), nullable=False, server_default=text("''"), comment='权限表名')
    table_id = Column(TINYINT(4), nullable=False, server_default=text("'0'"), comment='权限表id')
    table_resource_id = Column(String(50), nullable=False, server_default=text("''"), comment='权限表资源ID')
    all_selected = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否全选')
    operation_get = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='操作get')
    operation_put = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='操作put')
    operation_post = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='操作post')
    operation_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='操作delete')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, index=True, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class MiddlePermissionAccessCopy(Base):
    __tablename__ = 'middle_permission_access_copy'
    __table_args__ = (
        Index('table_id_name', 'table_name', 'table_resource_id'),
    )

    middle_permission_access_id = Column(String(32), primary_key=True)
    access = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='权限(0:未授权;1授权)')
    middle_permission_role_id = Column(String(32), nullable=False, index=True, comment='中台角色ID')
    employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='员工ID')
    permission_module_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='模块ID')
    table_name = Column(String(100), nullable=False, server_default=text("''"), comment='权限表名')
    table_id = Column(TINYINT(4), nullable=False, server_default=text("'0'"), comment='权限表id')
    table_resource_id = Column(String(50), nullable=False, server_default=text("''"), comment='权限表资源ID')
    operation_get = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='操作get')
    operation_put = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='操作put')
    operation_post = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='操作post')
    operation_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='操作delete')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, index=True, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class MiddlePermissionDatum(Base):
    __tablename__ = 'middle_permission_data'

    middle_permission_data_id = Column(String(32), primary_key=True)
    name = Column(String(255), nullable=False, server_default=text("''"), comment='数据权限名称')
    description = Column(String(255), nullable=False, server_default=text("''"), comment='数据权限描述')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class MiddlePermissionRole(Base):
    __tablename__ = 'middle_permission_role'

    middle_permission_role_id = Column(String(32), primary_key=True)
    name = Column(String(255), nullable=False, server_default=text("''"), comment='角色名')
    staus = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='状态(1启用，2停用)')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class MiddlePermissionRoleDataRelation(Base):
    __tablename__ = 'middle_permission_role_data_relation'

    middle_permission_role_data_relation_id = Column(String(32), primary_key=True)
    middle_permission_data_id = Column(String(32), nullable=False, comment='中台数据权限主键')
    middle_permission_role_id = Column(String(32), nullable=False, comment='角色主键')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class NetsignContract(Base):
    __tablename__ = 'netsign_contract'

    netSign_contract_id = Column(String(32), primary_key=True, comment='主键')
    contract_id = Column(String(32), nullable=False, index=True, server_default=text("''"), comment='合同ID')
    room_id = Column(String(32), comment='房间ID')
    netSign_sn = Column(String(50), nullable=False, server_default=text("''"), comment='网签登记号')
    netSign_no = Column(String(50), nullable=False, server_default=text("''"), comment='备案登记号')
    create_time = Column(INTEGER(11))
    update_time = Column(INTEGER(11))
    delete_time = Column(INTEGER(11))
    is_delete = Column(INTEGER(11))
    apartment_id = Column(String(32), comment='门店ID')


class Notice(Base):
    __tablename__ = 'notice'

    notice_id = Column(String(32), primary_key=True, server_default=text("''"))
    apartment_id = Column(String(32), server_default=text("''"), comment='门店ID')
    notice_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='1 LISA  2呼啦圈')
    notice_title = Column(String(255), nullable=False, server_default=text("''"), comment='标题')
    resource_url = Column(String(255), nullable=False, server_default=text("''"), comment='资源地址')
    notice_content = Column(String(2000), nullable=False, server_default=text("''"))
    publish_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='发布时间')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='1 正常，2 删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    operator_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人: 目前为employee_id')
    isPush = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否推送: 1否 2推送')


t_num = Table(
    'num', metadata,
    Column('i', INTEGER(11))
)


class OmeMember(Base):
    __tablename__ = 'ome_member'

    id = Column(INTEGER(11), primary_key=True, comment='主键')
    ome_member_id = Column(String(64), nullable=False, server_default=text("''"), comment='唯一id')
    commercial_name = Column(String(200), nullable=False, server_default=text("''"), comment='公司名称')
    id_name = Column(String(50), nullable=False, server_default=text("''"), comment='法人名称')
    id_no = Column(LargeBinary, nullable=False, comment='法人身份证')
    mobile_no = Column(LargeBinary, nullable=False, comment='电话号码')
    flag = Column(String(10), nullable=False, server_default=text("''"), comment='对公/对私 B 对公卡，C 对私卡')
    bank_name = Column(String(100), nullable=False, server_default=text("''"), comment='银行名称')
    branch_name = Column(String(100), nullable=False, server_default=text("''"), comment='支行名称')
    card_no = Column(LargeBinary, nullable=False, comment='银行账号')
    business_license = Column(String(100), nullable=False, server_default=text("''"), comment='营业执照编号')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    updat_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='状态1正常 0删除')


# class OperatorLog(Base):
#     __tablename__ = 'operator_log'
#
#     id = Column(INTEGER(11), primary_key=True)
#     operator_log_id = Column(String(60), nullable=False, server_default=text("''"))
#     code = Column(String(20), nullable=False, server_default=text("''"), comment='业务code')
#     type = Column(String(20), nullable=False, server_default=text("''"), comment='自定义类型')
#     text = Column(Text, nullable=False, comment='操作内容')
#     operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人id')
#     create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
#     update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
#     delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
#     table_name = Column(String(60), nullable=False, server_default=text("''"), comment='关联表名')
#     table_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='关联数据id')
#     order_no = Column(String(60), nullable=False, comment='订单号')


class Order(Base):
    __tablename__ = 'order'
    __table_args__ = (
        Index('table_id', 'table_id', 'table_name', unique=True),
    )

    order_id = Column(INTEGER(11), primary_key=True)
    order_no = Column(String(200), nullable=False, server_default=text("''"), comment='对外提供的唯一订单号')
    order_name = Column(String(128), nullable=False, server_default=text("''"), comment='订单名称')
    product_name = Column(String(100), nullable=False, server_default=text("''"), comment='第三方下单商品名')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    tenant_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='租客ID')
    service_code = Column(String(200), nullable=False, server_default=text("''"), comment='场景CODE')
    table_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='产生支付的表id')
    table_name = Column(String(64), nullable=False, server_default=text("''"), comment='产生支付的表名称')
    total_money = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='订单总金额')
    discount_money = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='优惠金额')
    pay_money = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='用户需要支付金额')
    is_complete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否支付完成 0 未完成 1 完成')
    first_pay_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='首次支付时间')
    last_pay_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='最后支付时间')
    from_way = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='以支付中心为准')
    return_url = Column(String(255), nullable=False, server_default=text("''"), comment='跳转地址')
    notify_url = Column(String(255), nullable=False, server_default=text("''"), comment='回调地址')
    expired_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='账单过期时间时间戳')
    order_status = Column(TINYINT(11), nullable=False, server_default=text("'0'"), comment='订单状态 0 正常 1 取消 2 异常')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class OrderCheckin(Base):
    __tablename__ = 'order_checkin'

    order_checkin_id = Column(INTEGER(11), primary_key=True)
    apartment_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='门店ID')
    room_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='房间ID')
    tenant_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='租客ID')
    tenant_phone = Column(String(11), nullable=False, server_default=text("''"), comment='租客手机号')
    tenant_name = Column(String(20), nullable=False, server_default=text("''"), comment='租客姓名')
    gender = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='性别（1男,2女）')
    deposit_month = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='押金付几月')
    rent_month = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='租金付几月')
    contract_cycle = Column(TINYINT(3), nullable=False, server_default=text("'0'"), comment='合同周期（月）')
    rental = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='租金(定价乘周期系数)')
    from_way = Column(TINYINT(2), nullable=False, server_default=text("'0'"), comment='以支付中心为准')
    discount_scale = Column(DECIMAL(6, 4), nullable=False, server_default=text("'1.0000'"), comment='租金周期系数')
    finance_scale = Column(DECIMAL(6, 4), nullable=False, comment='租金季付系数')
    ious_scale = Column(DECIMAL(6, 4), nullable=False, comment='租金分期系数')
    c_begin_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='合同开始时间')
    c_end_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='合同结束时间')
    preordain_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='预定ID')
    contract_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='合同ID')
    is_ious = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='新合同是否月付')
    pay_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='支付状态; 0未支付，1支付中，2取消支付，3支付失败，4支付成功，5支付金额错误')
    online_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='房间上线状态 0:来源Lisa 1: 订房上线 2:订房下线')
    order_status = Column(TINYINT(2), nullable=False, server_default=text("'0'"), comment='订单状态：0待审核 10已取消 20已审核 30已退款 99已作废')
    expired_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='过期时间')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class OrderCheckinFinance(Base):
    __tablename__ = 'order_checkin_finance'

    order_checkin_finance_id = Column(INTEGER(11), primary_key=True)
    order_checkin_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='入住订单主表ID')
    total_money = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='总金额')
    coupon_money = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='优惠金额')
    pay_money = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='支付金额')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class OrderCheckinIousFinance(Base):
    __tablename__ = 'order_checkin_ious_finance'

    order_checkin_ious_finance_id = Column(INTEGER(11), primary_key=True)
    order_checkin_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='入住订单主表ID')
    total_money = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='总金额')
    coupon_money = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='优惠金额')
    pay_money = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='支付金额')
    ious_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='分期类型（门店分期1，乐乎分期2）')
    is_master = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='分期主账单（乐乎分期的租金和服务费：1，门店分期：1）')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class OrderCostRelation(Base):
    __tablename__ = 'order_cost_relation'
    __table_args__ = (
        Index('table_id', 'table_id', 'table_name'),
    )

    order_cost_relation_id = Column(INTEGER(11), primary_key=True)
    cost_configuration_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='科目id')
    cost_name = Column(String(100), nullable=False, server_default=text("''"), comment='费用名称')
    cost_money = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='费用金额')
    table_name = Column(String(100), nullable=False, server_default=text("''"), comment='产生费用的表名称')
    table_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='产生费用的表ID')
    cost_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='费用类型(0:收入,1:支出)')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class OrderCoupon(Base):
    __tablename__ = 'order_coupon'
    __table_args__ = (
        Index('table_id', 'table_id', 'table_name'),
    )

    order_coupon_id = Column(INTEGER(11), primary_key=True)
    table_name = Column(String(100), nullable=False, server_default=text("''"), comment='使用优惠的表名称')
    table_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='使用优惠的表ID')
    coupon_number = Column(String(100), nullable=False, server_default=text("''"), comment='优惠券码')
    coupon_money = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='优惠金额')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')


class OrderGratuity(Base):
    __tablename__ = 'order_gratuity'

    order_gratuity_id = Column(INTEGER(11), primary_key=True)
    total_money = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='打赏总金额')
    remark = Column(String(255), nullable=False, server_default=text("''"), comment='备注')
    pay_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='支付状态; 0未支付，1支付中，2取消支付，3支付失败，4支付成功，5支付金额错误')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class OrderMfixLog(Base):
    __tablename__ = 'order_mfix_log'

    order_mfix_log_id = Column(INTEGER(11), primary_key=True)
    table_name = Column(String(60), nullable=False, server_default=text("''"), comment='新表名')
    table_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='老表id')
    old_table_name = Column(String(60), nullable=False, server_default=text("''"), comment='新表名')
    old_table_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='老表id')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class OrderNotifyLog(Base):
    __tablename__ = 'order_notify_log'
    __table_args__ = (
        Index('order_id', 'order_id', 'order_pay_detail_id', unique=True),
    )

    order_notify_log_id = Column(INTEGER(11), primary_key=True)
    order_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='订单ID')
    order_pay_detail_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='支付订单ID')
    status = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='返回码')
    message = Column(Text, nullable=False, comment='返回描述')
    data = Column(Text, comment='返回数据')
    notify_data = Column(Text, comment='回调参数')
    notify_method = Column(String(255), nullable=False, server_default=text("''"), comment='调用lisa的回掉方法')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class OrderPayDetail(Base):
    __tablename__ = 'order_pay_detail'
    __table_args__ = (
        Index('new_t', 'pay_time', 'pay_status'),
    )

    order_pay_detail_id = Column(INTEGER(11), primary_key=True)
    order_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='订单表ID')
    order_no = Column(String(200), nullable=False, index=True, server_default=text("''"), comment='对外提供的唯一订单号')
    merchant_id = Column(String(200), nullable=False, index=True, server_default=text("''"), comment='商户号')
    withdraw_no = Column(String(32), nullable=False, server_default=text("''"), comment='提现单号')
    withdraw_status = Column(TINYINT(2), nullable=False, server_default=text("'0'"), comment='提现状态：1:申请中 2:提现成功 3:提现失败')
    refund_money = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='已退款金额')
    last_refund_status = Column(TINYINT(11), nullable=False, server_default=text("'0'"), comment='最后更新的退款状态 1:退款中 2:退款成功 3:退款失败')
    document_number = Column(String(200), nullable=False, index=True, server_default=text("''"), comment='第三方订单号')
    order_name = Column(String(128), nullable=False, server_default=text("''"), comment='订单名称')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    tenant_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='租客ID')
    payer_id = Column(String(64), nullable=False, server_default=text("''"), comment='付款方信息(第三方)')
    service_code = Column(String(200), nullable=False, server_default=text("''"), comment='场景CODE')
    pay_money = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='支付金额')
    pay_standard = Column(DECIMAL(10, 4), nullable=False, server_default=text("'0.0000'"), comment='收费标准')
    pay_standard_money = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='第三方手续费')
    received_money = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='用户实际支付金额')
    pay_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='支付时间')
    pay_channel = Column(String(10), nullable=False, server_default=text("''"), comment='以支付中心为准')
    pay_way = Column(String(10), nullable=False, server_default=text("''"), comment='以支付中心为准')
    from_way = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='订单来源')
    pay_status = Column(TINYINT(1), nullable=False, index=True, server_default=text("'0'"), comment='支付状态 0未支付，1支付中，2取消支付，3支付失败，4支付成功,5支付金额错误')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除 0=未删除  1=已删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class OrderPreordain(Base):
    __tablename__ = 'order_preordain'

    order_preordain_id = Column(INTEGER(11), primary_key=True)
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    from_way = Column(TINYINT(2), nullable=False, server_default=text("'0'"), comment='以支付中心为准')
    room_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='房间ID')
    tenant_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='租客ID')
    tenant_phone = Column(String(11), nullable=False, server_default=text("''"), comment='租客手机号')
    tenant_name = Column(String(20), nullable=False, server_default=text("''"), comment='租客姓名')
    preordain_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='预定ID')
    safety_code = Column(MEDIUMINT(8), nullable=False, server_default=text("'0'"), comment='预定短信安全码')
    check_in_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='预计入住时间')
    total_money = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='总金额')
    coupon_money = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='优惠金额')
    pay_money = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='支付金额')
    pay_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='支付状态; 0未支付，1支付中，2取消支付，3支付失败，4支付成功，5支付金额错误')
    online_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='房间上线状态 0:来源Lisa 1: 订房上线 2:订房下线')
    order_status = Column(TINYINT(2), nullable=False, server_default=text("'0'"), comment='订单状态：0待审核 10已取消 20已审核 30已退款 99已作废')
    expired_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='过期时间')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class OrderRenewalFinance(Base):
    __tablename__ = 'order_renewal_finance'

    order_renewal_finance_id = Column(INTEGER(11), primary_key=True)
    renewal_routine_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='续租申请主表ID')
    total_money = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='总金额')
    coupon_money = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='优惠金额')
    pay_money = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='支付金额')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class OrderRenewalIousFinance(Base):
    __tablename__ = 'order_renewal_ious_finance'

    order_renewal_ious_finance_id = Column(INTEGER(11), primary_key=True)
    renewal_routine_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='续租申请主表ID')
    total_money = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='总金额')
    coupon_money = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='优惠金额')
    pay_money = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='支付金额')
    ious_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='分期类型（门店分期1，乐乎分期2）')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class OrderRent(Base):
    __tablename__ = 'order_rent'

    order_rent_id = Column(INTEGER(11), primary_key=True)
    contract_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='合同ID')
    from_way = Column(TINYINT(2), nullable=False, server_default=text("'0'"), comment='以支付中心为准')
    tenant_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='租客ID')
    contract_finance_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='季付（月付）第一期合同账单ID')
    current_pay_month = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='当前支付总期数')
    rental = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='租金(定价乘周期系数)')
    deposit_month = Column(TINYINT(2), nullable=False, server_default=text("'0'"), comment='押金支付月份')
    rent_month = Column(TINYINT(2), nullable=False, server_default=text("'0'"), comment='租金支付月份')
    begin_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='季付（月付）第一期的开始时间')
    is_pay = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否发生支付')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class OrderRentFinance(Base):
    __tablename__ = 'order_rent_finance'

    order_rent_finance_id = Column(INTEGER(11), primary_key=True)
    order_rent_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='合同收租订单主表ID')
    total_money = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='总金额')
    coupon_money = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='优惠金额')
    pay_money = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='支付金额')
    rental = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='租金(定价乘周期系数)')
    finance_scale = Column(DECIMAL(6, 4), nullable=False, comment='租金季付系数')
    contract_finance_id = Column(String(100), nullable=False, server_default=text("''"), comment='合同账单ID（4，5，6）')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class OrderRentIousFinance(Base):
    __tablename__ = 'order_rent_ious_finance'

    order_rent_ious_finance_id = Column(INTEGER(11), primary_key=True)
    order_rent_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='合同收租订单主表ID')
    total_money = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='总金额')
    coupon_money = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='优惠金额')
    pay_money = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='支付金额')
    contract_finance_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='合同账单ID')
    rental = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='租金(定价乘周期系数)')
    service_fee = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='分期服务费')
    lase_fee = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='滞纳金')
    ious_scale = Column(DECIMAL(6, 4), nullable=False, comment='分期系数')
    ious_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='分期类型（门店分期1，乐乎分期2）')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class Organization(Base):
    __tablename__ = 'organization'

    organization_id = Column(INTEGER(11), primary_key=True, comment='ID')
    name = Column(String(50), nullable=False, server_default=text("''"), comment='主体名称')
    domain_prefix = Column(String(100), nullable=False, server_default=text("''"), comment='域名前缀')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class OrganizationMerchant(Base):
    __tablename__ = 'organization_merchant'

    id = Column(INTEGER(11), primary_key=True)
    organization_merchant_id = Column(String(32), nullable=False, server_default=text("''"), comment='机构商户号ID')
    merchant_type = Column(String(32), nullable=False, server_default=text("'0'"), comment='通道')
    city_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='城市ID')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    org_sub_merchant_id = Column(String(64), nullable=False, server_default=text("'0'"), comment='机构子商户号')
    org_merchant_id = Column(String(64), nullable=False, server_default=text("'0'"), comment='机构主商户号')
    merchant_id = Column(String(64), nullable=False, server_default=text("'0'"), comment='商户号')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='更新时间')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人ID')
    band_num = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='绑定次数')
    is_band = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否绑定')


class OtherFinanceCostRelation(Base):
    __tablename__ = 'other_finance_cost_relation'

    other_finance_cost_id = Column(INTEGER(11), primary_key=True, comment='自增ID')
    contract_finance_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='合同账单ID')
    bill_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='账单ID')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class OwnerFeedback(Base):
    __tablename__ = 'owner_feedback'

    owner_feedback_id = Column(BIGINT(19), primary_key=True)
    employee_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='甲方id')
    question_type = Column(TINYINT(4), nullable=False, server_default=text("'1'"), comment='服务类型(1 服务问题、2 人员问题、3 经营问题、4 其他)')
    question_desc = Column(String(2555), nullable=False, server_default=text("''"), comment='详情描述')
    feedback_status = Column(TINYINT(4), nullable=False, server_default=text("'1'"), comment='反馈状态(1 已提交 2 已接收 3 已处理 4 已评价)')
    resolve_status = Column(TINYINT(4), nullable=False, server_default=text("'0'"), comment='是否解决问题(1 未解决 2 已解决)')
    comment_star = Column(DECIMAL(10, 1), nullable=False, server_default=text("'0.0'"), comment='评论星级')
    comment_desc = Column(String(2555), nullable=False, server_default=text("''"), comment='评论描述')
    resolve_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='反馈处理人id')
    answer_desc = Column(String(2555), nullable=False, server_default=text("''"), comment='处理结果')
    receive_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='接收时间')
    resolve_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='处理时间')
    comment_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='评论时间')
    apartment_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='门店id')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='删除状态')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class PayApartmentRec(Base):
    __tablename__ = 'pay_apartment_rec'

    id = Column(INTEGER(11), primary_key=True, comment='自增id')
    pay_apartment_rec_id = Column(String(60), nullable=False, server_default=text("''"), comment='uuid')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店id')
    rec_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='0:未交易1:未对账2.已对账')
    rec_number = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='已对账笔数')
    not_rec_number = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='未对账条数')
    sum_number = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='总笔数')
    rec_result = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='0.默认值1.不匹配2.完全匹配')
    rec_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='对账时间')
    clear_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='清算日期')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='1.正常2.删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class PayApiNotifyInfo(Base):
    __tablename__ = 'pay_api_notify_info'
    __table_args__ = (
        Index('table_id_name', 'table_id', 'table_name'),
    )

    notify_info_id = Column(INTEGER(11), primary_key=True)
    table_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='来源表id')
    table_name = Column(String(64), nullable=False, server_default=text("''"), comment='来源表名')
    notify_url = Column(String(255), nullable=False, server_default=text("''"), comment='下游异步结果下发地址')
    notify_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='下游回调状态 0未回调 1回调失败 2回调成功')
    notify_count = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='下游回调次数(超过8次回调失败)')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class PayApiNotifyLog(Base):
    __tablename__ = 'pay_api_notify_log'

    notify_log_id = Column(INTEGER(11), primary_key=True)
    notify_info_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='回调信息ID')
    notify_content = Column(Text, comment='回调内容')
    notify_return = Column(Text, comment='回调同步返回')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class PayApiTransfer(Base):
    __tablename__ = 'pay_api_transfer'

    api_transfer_id = Column(INTEGER(11), primary_key=True)
    out_trade_no = Column(String(100), nullable=False, index=True, server_default=text("''"), comment='第三方交易单号')
    document_number = Column(String(32), nullable=False, index=True, server_default=text("''"), comment='用于和第三方交互单号')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class PayChannelCashierConfiguration(Base):
    __tablename__ = 'pay_channel_cashier_configuration'

    pay_channel_cashier_configuration_id = Column(INTEGER(11), primary_key=True)
    pay_channel = Column(String(200), nullable=False, server_default=text("''"), comment='支付渠道')
    pay_way = Column(String(200), nullable=False, server_default=text("''"), comment='支付方式')
    pay_standard = Column(DECIMAL(10, 4), nullable=False, server_default=text("'0.0000'"), comment='手续费(按比例)')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    pay_alias = Column(String(50), nullable=False, server_default=text("''"), comment='支付别名')
    pay_channel_type = Column(String(255), nullable=False, server_default=text("''"), comment='收银台类型')
    merchant_id = Column(String(200), nullable=False, server_default=text("''"), comment='商户号')


class PayConfiguration(Base):
    __tablename__ = 'pay_configuration'

    pay_configuration_id = Column(INTEGER(11), primary_key=True, comment='付款方式ID')
    pay_name = Column(String(32), nullable=False, comment='付款名称')
    pay_number = Column(INTEGER(2), nullable=False, server_default=text("'0'"), comment='支付数字')
    discount = Column(DECIMAL(4, 2), nullable=False, server_default=text("'1.00'"), comment='折扣')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class PayMerchant(Base):
    __tablename__ = 'pay_merchant'
    __table_args__ = (
        Index('table_id_name', 'table_id', 'table_name'),
    )

    pay_merchant_id = Column(INTEGER(11), primary_key=True)
    table_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='子商户表id')
    table_name = Column(String(64), nullable=False, server_default=text("''"), comment='子商户表名')
    tenant_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='租客id')
    merchant_type = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='商户号类型：1:个人 2:企业')
    merchant_name = Column(String(32), nullable=False, server_default=text("''"), comment='商户别名')
    merchant_id = Column(String(32), nullable=False, index=True, server_default=text("''"), comment='商户ID')
    merchant_balance = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='商户余额 单位分')
    reserve_amount = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='商户备用金')
    pay_channel = Column(String(10), nullable=False, server_default=text("''"), comment='支付渠道C：畅捷，W:微信，S：靠浦E付, AI: 云商通')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    account_type = Column(String(100), nullable=False, server_default=text("''"), comment='账户类型:公共public,门店apartment')
    use_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='商户启用状态 1启用 2停用')
    cash_withdrawal_service_charge = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='提现手续费')
    password_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='密码状态')
    trans_sgn = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='转账免密状态:0.未签约1.已签约')
    trans_sgn_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='免密有效期')
    trans_amount = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='密码额度')


class PayMerchantApartment(Base):
    __tablename__ = 'pay_merchant_apartment'

    pay_merchant_apartment_id = Column(INTEGER(11), primary_key=True)
    pay_merchant_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='商户id')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店id')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class PayMerchantCard(Base):
    __tablename__ = 'pay_merchant_card'

    pay_merchant_card_id = Column(INTEGER(11), primary_key=True)
    pay_merchant_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='会员ID')
    card_alias = Column(String(50), nullable=False, server_default=text("''"), comment='卡别名')
    card_no_md5 = Column(String(32), nullable=False, index=True, server_default=text("''"), comment='银行卡号MD5')
    card_no = Column(LargeBinary, nullable=False, comment='银行卡密文')
    merchant_type = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='商户号类型：1:个人 2:企业')
    phone_md5 = Column(String(32), nullable=False, index=True, server_default=text("''"), comment='预留手机号MD5')
    phone = Column(LargeBinary, nullable=False, comment='预留手机号码密文')
    card_check = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='绑卡方式 1: 三要素 2: 四要素+短信 3: 实名付 5: 账户实名认证(四要素)')
    bank_name = Column(String(100), nullable=False, server_default=text("''"), comment='银行名称')
    bank_code = Column(String(30), nullable=False, index=True, server_default=text("''"), comment='银行代码')
    bank_city_no = Column(String(50), nullable=False, server_default=text("''"), comment='开户行地区代码')
    branch_bank_name = Column(String(50), nullable=False, server_default=text("''"), comment='开户行支行名称')
    union_bank = Column(String(50), nullable=False, server_default=text("''"), comment='支付行号 12位数字,非直连出金范围内的银行，必填')
    card_type = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='银行卡类型 1:储蓄卡 2:信用卡')
    validate = Column(String(10), nullable=False, server_default=text("''"), comment='有效期(信用卡必填，格式为年月， 如 2103)')
    cvv2 = Column(String(6), nullable=False, server_default=text("''"), comment='CVV2校验码(信用卡必填)')
    is_safe_card = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否安全卡')
    bind_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='绑定状态 0:绑定中 1:成功 2:失败 3:解绑')
    allinpay_trance_num = Column(String(100), nullable=False, server_default=text("''"), comment='云商通申请绑卡流水号')
    allinpay_trans_date = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='云商通申请时间')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    account_type = Column(String(100), nullable=False, server_default=text("''"), comment='账户类型:公共public,门店apartment')
    name = Column(String(100), nullable=False, server_default=text("''"), comment='银行卡的开户名称')


class PayMerchantConfig(Base):
    __tablename__ = 'pay_merchant_config'

    pay_merchant_config_id = Column(INTEGER(11), primary_key=True)
    merchant_id = Column(String(255), nullable=False, server_default=text("''"), comment='商户号')
    key = Column(String(255), nullable=False, server_default=text("''"), comment='商户号对应的密钥')
    apartment_name = Column(String(100), nullable=False, server_default=text("''"), comment='门店名称')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    remarks = Column(String(100), nullable=False, server_default=text("''"), comment='备注')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class PayMerchantFlow(Base):
    __tablename__ = 'pay_merchant_flow'
    __table_args__ = (
        Index('table_id_name', 'table_id', 'table_name'),
    )

    flow_id = Column(INTEGER(11), primary_key=True)
    merchant_id = Column(String(32), nullable=False, index=True, server_default=text("''"), comment='商户ID')
    table_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='来源表id')
    table_name = Column(String(64), nullable=False, server_default=text("''"), comment='来源表名')
    out_trade_no = Column(String(32), nullable=False, index=True, server_default=text("''"), comment='业务单号')
    service_code = Column(String(50), nullable=False, index=True, server_default=text("''"), comment='业务Code 付款:payment 收款:receipt 转入:trans_into 转出:trans_out 充值:recharge 退款:refund 提现:withdraw 提现手续费:withdraw_service_charge')
    trading_amount = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='交易金额(分)')
    trading_type = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='交易类型(1:收入,2:支出)')
    trading_channel = Column(String(30), nullable=False, server_default=text("''"), comment='交易渠道')
    trading_way = Column(String(30), nullable=False, server_default=text("''"), comment='交易方式')
    trading_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='交易状态 1:处理中 2:处理成功 3:处理失败 4:金额错误')
    trading_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='交易完成时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class PayMerchantNoticeNotify(Base):
    __tablename__ = 'pay_merchant_notice_notify'

    notice_notify_id = Column(INTEGER(11), primary_key=True)
    table_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作表id')
    table_name = Column(String(100), nullable=False, server_default=text("''"), comment='操作表名称')
    request_content = Column(Text, comment='发起回调内容')
    request_return = Column(Text, comment='发起回调后返回内容')
    notify_third_content = Column(Text, comment='第三方异步回调内容')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    business_notify_url = Column(String(255), nullable=False, server_default=text("''"), comment='通知业务系统的回调地址')


class PayMerchantRec(Base):
    __tablename__ = 'pay_merchant_rec'

    id = Column(INTEGER(11), primary_key=True, comment='自增id')
    pay_merchant_rec_id = Column(String(60), nullable=False, server_default=text("''"), comment='uuid')
    merchant_id = Column(String(200), nullable=False, server_default=text("''"), comment='商户号id')
    sum_number = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='资金笔数')
    sum_amount = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='业务总金额')
    external_sum_number = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='第三方总笔数')
    external_sum_amount = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='第三方平台金额')
    external_late_amount = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='平台手续费')
    external_close_amount = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='平台结算金额')
    rec_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='0不匹配1匹配')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='1正常2删除')
    clear_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='清算日期')
    apartment_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='门店id')


class PayMerchantRecDetail(Base):
    __tablename__ = 'pay_merchant_rec_detail'

    id = Column(INTEGER(11), primary_key=True, comment='自增id')
    pay_merchant_rec_detail_id = Column(String(60), nullable=False, server_default=text("''"), comment='对账明细uuid')
    pay_channel = Column(String(10), nullable=False, server_default=text("''"), comment='支付渠道C：畅捷，W:微信，S：靠浦E付, AI: 云商通,OME:水滴')
    business_type = Column(String(50), nullable=False, server_default=text("''"), comment='业务类型')
    rec_result = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='对账结果:0.不匹配,1完全匹配')
    rec_result_describe = Column(TINYINT(1), nullable=False, server_default=text("'5'"), comment='0,全部一致，1.业务多订单，2.平台多订单，3.金额不一致，4.状态不一致，5.金额与状态不一致')
    oper_result = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='0.无需处理,1.未处理,2.已处理')
    oper_mode = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='处理结果0:默认,1.以业务侧为准2.以平台为准')
    oper_comment = Column(String(500), nullable=False, server_default=text("''"), comment='差异原因')
    oper_user_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人id')
    oper_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='处理时间')
    document_number = Column(String(100), nullable=False, server_default=text("''"), comment='订单号')
    bill_number = Column(String(100), nullable=False, server_default=text("''"), comment='业务订单号')
    business_tran_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='业务系统交易时间')
    tenant_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='租客id')
    tenant_name = Column(String(50), nullable=False, server_default=text("''"), comment='租客名称')
    cost_name = Column(String(500), nullable=False, server_default=text("'[]'"), comment='费用名称')
    business_amount = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='交易金额')
    business_cost_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='0,失败1,成功 ')
    business_mode = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='生成方式0:缺失值1.系统2.手动')
    business_flow_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='流水状态:0默认1.正常2.挂账3.作废')
    order_no = Column(String(100), nullable=False, server_default=text("''"), comment='第三方订单号')
    tran_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='平台交易时间')
    amount = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='平台交易金额')
    late_amount = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='手续费')
    close_amount = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='结算金额')
    pay_way = Column(String(50), nullable=False, server_default=text("''"), comment='支付渠道(仅表示微信支付还是支付宝支付)WS微信AS支付宝')
    cost_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='0,失败1,成功 ')
    tran_mode = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='生成方式0:缺失值1.系统2.手动')
    tran_flow_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='流水状态:0默认1.正常2.挂账3.作废')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='1正常2.删除')
    merchant_id = Column(String(200), nullable=False, server_default=text("''"), comment='商户号')
    apartment_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='门店id')
    rec_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='对账时间')
    clear_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='清算时间')
    oper_delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='1正常2.删除')


class PayMerchantRecLog(Base):
    __tablename__ = 'pay_merchant_rec_log'

    id = Column(INTEGER(11), primary_key=True)
    pay_merchant_rec_log_id = Column(String(64), nullable=False, server_default=text("''"), comment='主键')
    operator_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment=' 操作人id')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='状态')
    before_version = Column(String(255), nullable=False, server_default=text("''"), comment='上个版本')
    before = Column(INTEGER(11), nullable=False, comment='上个版本detailid')
    after_version = Column(String(255), nullable=False, server_default=text("''"), comment='当前版本')
    after_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='当前版本id')
    pay_merchant_rec_id = Column(String(255), nullable=False, server_default=text("''"), comment='对账表id')
    pay_merchant_rec_detail_id = Column(String(255), nullable=False, server_default=text("''"), comment='对账细节id')
    remark = Column(String(255), nullable=False, server_default=text("''"), comment='注视')
    pay_merchant_rec_log_detail_id = Column(String(64), nullable=False, server_default=text("''"), comment='日志id')
    apartment_id = Column(INTEGER(11), nullable=False, comment='门店id')
    merchant_id = Column(String(255), nullable=False, server_default=text("''"), comment='商户号')
    out_trade_no = Column(String(255), nullable=False, server_default=text("''"), comment='订单号')
    bill_id = Column(String(64), nullable=False, server_default=text("''"), comment='账单好')
    document_number = Column(String(64), nullable=False, server_default=text("''"), comment='交易号')


class PayMerchantRecLogDetail(Base):
    __tablename__ = 'pay_merchant_rec_log_detail'

    id = Column(INTEGER(11), primary_key=True, comment='主键')
    pay_merchant_rec_log_id = Column(String(64), nullable=False, server_default=text("''"), comment='日志细节id')
    log_detail_id = Column(String(64), nullable=False, server_default=text("''"), comment='日志表id')
    data_json = Column(Text, nullable=False, comment='某个版本的详情数据')
    update_time = Column(INTEGER(11), server_default=text("'0'"), comment='更新时间')
    create_time = Column(INTEGER(11), server_default=text("'0'"), comment='创建时间')
    delete_time = Column(INTEGER(11), server_default=text("'0'"), comment='删除时间')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='1 未删除 2已删除')


class PayMerchantRecVerifyStatu(Base):
    __tablename__ = 'pay_merchant_rec_verify_status'

    id = Column(INTEGER(11), primary_key=True, comment='主键')
    detail_id = Column(String(64), nullable=False, index=True, server_default=text("''"), comment='对账细节id')
    v_status = Column(INTEGER(2), nullable=False, server_default=text("'1'"), comment='1 核销成功 2 核销失败 3处理异常 4 账单侧无数据')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class PayMerchantReconciliation(Base):
    __tablename__ = 'pay_merchant_reconciliation'

    id = Column(INTEGER(11), primary_key=True)
    pay_merchant_reconciliation_id = Column(String(64), nullable=False, server_default=text("''"))
    merchant_id = Column(String(32), nullable=False, server_default=text("''"), comment='商户id')
    date_char = Column(String(20), nullable=False, server_default=text("''"), comment='对账日期')
    revenue = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='当日营收')
    tl_revenue = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='通联营收')
    separate = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='平台分账')
    tl_separate = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='通联分账')
    balance = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='平台余额')
    tl_balance = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='通联余额')
    transfer = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='平台转出')
    tl_transfer = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='通联转出')
    withdraw = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='平台提现')
    tl_withdraw = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='通联提现')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='状态')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class PayMerchantRefund(Base):
    __tablename__ = 'pay_merchant_refund'

    pay_merchant_refund_id = Column(INTEGER(11), primary_key=True)
    order_pay_detail_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='支付订单id')
    pay_merchant_id = Column(String(100), nullable=False, server_default=text("'0'"), comment='付款会员ID')
    biz_user_id = Column(String(100), nullable=False, server_default=text("'0'"), comment='收款会员ID(租客)')
    refund_no = Column(String(100), nullable=False, server_default=text("''"), comment='退款申请单号')
    out_trade_no = Column(String(100), nullable=False, server_default=text("''"), comment='第三方退款单号(本期暂指云商通)')
    amount = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='退款金额')
    back_url = Column(Text, comment='通知回调地址')
    pay_way = Column(String(10), nullable=False, server_default=text("'0'"))
    pay_channel = Column(String(10), nullable=False, server_default=text("'0'"))
    document_number = Column(String(64), nullable=False, server_default=text("''"))
    pay_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='退款状态 1:退款中 2:退款成功 3:退款失败')
    refund_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='退款到账时间')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    error_message = Column(String(100), nullable=False, server_default=text("''"), comment='失败信息')
    refund_where = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='退款去向 1云商通账户余额 2原路退回')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class PayMerchantTransfer(Base):
    __tablename__ = 'pay_merchant_transfer'

    pay_merchant_transfer_id = Column(INTEGER(11), primary_key=True)
    transfer_no = Column(String(100), nullable=False, index=True, server_default=text("''"), comment='分账单号')
    out_trade_no = Column(String(100), nullable=False, index=True, server_default=text("''"), comment='第三方交易单号(本期暂指云商通)')
    from_merchant_id = Column(String(32), nullable=False, index=True, server_default=text("''"), comment='转出商户ID')
    to_merchant_id = Column(String(100), nullable=False, index=True, server_default=text("'0'"), comment='转入商户ID')
    amount = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='金额(分)')
    pay_channel = Column(String(10), nullable=False, server_default=text("''"), comment='支付渠道')
    pay_way = Column(String(10), nullable=False, server_default=text("''"), comment='支付途径')
    pay_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='状态 1:申请中 2:成功 3:失败 4:异常')
    payment_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='到账时间')
    error_message = Column(MEDIUMTEXT, comment='失败信息')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    notify_url = Column(String(255), nullable=False, server_default=text("''"), comment='回调地址')
    trans_sgn = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='免密使用')
    remark = Column(String(500), nullable=False, server_default=text("''"), comment='备注')


class PayMerchantWithdraw(Base):
    __tablename__ = 'pay_merchant_withdraw'

    pay_merchant_withdraw_id = Column(INTEGER(11), primary_key=True)
    pay_merchant_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='会员ID')
    withdraw_no = Column(String(32), nullable=False, index=True, server_default=text("''"), comment='提现申请单号')
    out_trade_no = Column(String(200), nullable=False, index=True, server_default=text("''"), comment='第三方提现单号')
    amount = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='提现金额')
    received_money = Column(DECIMAL(10, 0), nullable=False, server_default=text("'0'"), comment='实际已收金额')
    fee = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='提现手续费')
    card_no_md5 = Column(String(32), nullable=False, index=True, server_default=text("''"), comment='提现银行卡号MD5')
    card_no = Column(LargeBinary, nullable=False, comment='提现银行卡密文')
    withdraw_type = Column(String(20), nullable=False, server_default=text("'T0'"), comment='提现方式: T0:T+0到账 T1:T+1到账')
    withdraw_status = Column(TINYINT(2), nullable=False, server_default=text("'0'"), comment='提现状态：0:提现中 1:提现失败 2:提现成功 3:金额错误')
    withdraw_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='提现到账时间')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class PayMerchantWithdrawNotify(Base):
    __tablename__ = 'pay_merchant_withdraw_notify'

    notify_id = Column(INTEGER(11), primary_key=True)
    withdraw_no = Column(String(32), nullable=False, index=True, server_default=text("''"), comment='提现申请单号')
    request_content = Column(Text, comment='发起回调内容')
    request_return = Column(Text, comment='发起回调后返回内容')
    notify_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='回调状态 0未回调 1回调失败 2回调成功')
    notify_third_content = Column(Text, comment='第三方异步回调内容')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class PayPaymentConf(Base):
    __tablename__ = 'pay_payment_conf'

    payment_conf_id = Column(INTEGER(11), primary_key=True)
    client_code = Column(String(200), nullable=False, server_default=text("''"), comment='客户端')
    client_name = Column(String(200), nullable=False, server_default=text("''"), comment='客户端名称')
    pay_channel = Column(String(200), nullable=False, server_default=text("''"), comment='支付渠道')
    pay_channel_name = Column(String(200), nullable=False, server_default=text("''"), comment='支付渠道名')
    pay_way = Column(String(200), nullable=False, server_default=text("''"), comment='支付方式')
    pay_way_name = Column(String(200), nullable=False, server_default=text("''"), comment='支付方式名')
    pay_alias = Column(String(200), server_default=text("''"), comment='别名')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id_back = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class PayTermLog(Base):
    __tablename__ = 'pay_term_log'

    pay_term_log_id = Column(INTEGER(11), primary_key=True, comment='月付支付日志')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    contract_finance_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='账单ID')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间')


class PayUponCommision(Base):
    __tablename__ = 'pay_upon_commision'

    commision_id = Column(INTEGER(11), primary_key=True)
    pay_merchant_transfer_id = Column(INTEGER(11), nullable=False, index=True, comment='分账ID')
    apartment_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='门店ID')
    commision_scale = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='提佣比例')
    pay_merchant_id = Column(String(32), nullable=False, index=True, server_default=text("''"), comment='付拥商户ID')
    to_merchant_id = Column(VARCHAR(32), nullable=False, index=True, server_default=text("''"), comment='收佣商户ID')
    amount = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='需结佣金额(分)')
    daily_amount = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='当日可结佣金额(分)')
    daily_closed_amount = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='当日已结佣金额(分)')
    status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='状态 1:未处理 2:处理中 3:成功 4:失败 5:异常')
    commision_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='结佣到账时间')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


t_pay_upon_commision_conf = Table(
    'pay_upon_commision_conf', metadata,
    Column('apartment_id', INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='门店ID'),
    Column('commision_scale', INTEGER(11), nullable=False, server_default=text("'0'"), comment='提佣比例'),
    Column('pay_merchant_id', String(32), nullable=False, index=True, server_default=text("''"), comment='付拥商户ID'),
    Column('to_merchant_id', String(32), nullable=False, index=True, server_default=text("''"), comment='收佣商户ID'),
    Column('operator_employee_id', INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人'),
    Column('create_time', INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间'),
    Column('update_time', INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间'),
    Column('is_delete', TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除'),
    Column('delete_time', INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
)


class PaymentSubjectInfoConfig(Base):
    __tablename__ = 'payment_subject_info_config'

    payment_subject_id = Column(String(32), primary_key=True, server_default=text("''"), comment='主键')
    service_code = Column(String(40), nullable=False, server_default=text("''"), comment="场景code:  preordain => '预定',contract_finance => '合同账单',ious_finance => '分期账单',rent => '入住',ious_rent => '入住并分期',surrender  => '退租',reservation_surrender => '委托转租',electricity_recharge  => '智能电表',activity_goods => '平台活动商品',renew => '续租',ious_renew => '续租并分期',renewals => '杂费',switch_room  => '换房',gratuity => '打赏',cleaning => '保洁',canceled => '解除协议',tenant_auth  => '租客认证',aha_style => '阿哈生活',")
    service_code_name = Column(String(60), nullable=False, server_default=text("'\"\"'"), comment='场景code')
    subject_info_id = Column(String(32), nullable=False, server_default=text("'0'"), comment='科目id')
    subject_info_name = Column(String(32), nullable=False, server_default=text("'\"\"'"), comment='科目名称')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class PermissionAcces(Base):
    __tablename__ = 'permission_access'
    __table_args__ = (
        Index('table_id_name', 'table_name', 'table_id'),
        Index('idx_permissionroleid_tablename_isdelete_tableid', 'permission_role_id', 'table_name', 'is_delete', 'table_id')
    )

    permission_access_id = Column(INTEGER(11), primary_key=True)
    company_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='公司ID')
    access = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='权限(0:未授权;1授权)')
    permission_role_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='角色ID')
    employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='员工ID')
    permission_module_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='模块ID')
    table_name = Column(String(100), nullable=False, server_default=text("''"), comment='权限表名')
    table_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='权限表ID')
    all_selected = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否做前台展示')
    operation_get = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='操作get')
    operation_put = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='操作put')
    operation_post = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='操作post')
    operation_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='操作delete')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, index=True, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    organization_id = Column(INTEGER(1), nullable=False, server_default=text("'0'"), comment='组织ID')


class PermissionAccess07181400(Base):
    __tablename__ = 'permission_access_07-18-14:00'
    __table_args__ = (
        Index('table_id_name', 'table_name', 'table_id'),
    )

    permission_access_id = Column(INTEGER(11), primary_key=True)
    company_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='公司ID')
    access = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='权限(0:未授权;1授权)')
    permission_role_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='角色ID')
    employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='员工ID')
    permission_module_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='模块ID')
    table_name = Column(String(100), nullable=False, server_default=text("''"), comment='权限表名')
    table_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='权限表ID')
    operation_get = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='操作get')
    operation_put = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='操作put')
    operation_post = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='操作post')
    operation_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='操作delete')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, index=True, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    organization_id = Column(INTEGER(1), nullable=False, server_default=text("'0'"), comment='组织ID')


class PermissionAction(Base):
    __tablename__ = 'permission_action'

    permission_action_id = Column(INTEGER(11), primary_key=True)
    name = Column(String(255), nullable=False, server_default=text("''"), comment='页面名')
    controller = Column(String(255), nullable=False, server_default=text("''"), comment='控制器')
    action = Column(String(255), nullable=False, server_default=text("''"), comment='操作器')
    operation_get = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='操作get')
    operation_put = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='操作put')
    operation_post = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='操作post')
    operation_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='操作delete')
    description = Column(String(255), nullable=False, server_default=text("''"), comment='页面描述')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class PermissionDatum(Base):
    __tablename__ = 'permission_data'

    permission_data_id = Column(INTEGER(11), primary_key=True)
    name = Column(String(255), nullable=False, server_default=text("''"), comment='数据名')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class PermissionExtra(Base):
    __tablename__ = 'permission_extra'

    permission_extra_id = Column(INTEGER(11), primary_key=True, comment='额外权限项ID')
    name = Column(String(64), nullable=False, server_default=text("''''''"), comment='额外权限名称')
    distinguish_name = Column(String(64), nullable=False, server_default=text("''''''"), comment='唯一识别名称')
    organization_id = Column(INTEGER(1), nullable=False, server_default=text("'0'"), comment='组织ID')


class PermissionMenu(Base):
    __tablename__ = 'permission_menu'
    __table_args__ = (
        Index('idx_menuresourceid_isdelete_organizationid_resourcetype', 'menu_resource_id', 'is_delete', 'organization_id', 'resource_type'),
    )

    permission_menu_id = Column(INTEGER(11), primary_key=True)
    menu_resource_id = Column(String(50), nullable=False, index=True, server_default=text("''"), comment='uuid')
    name = Column(String(255), nullable=False, server_default=text("''"), comment='菜单')
    parent_permission_menu_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='父菜单ID')
    order = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='排序')
    ico = Column(String(64), nullable=False, server_default=text("''"), comment='图标')
    url = Column(String(252), nullable=False, server_default=text("''"), comment='跳转地址')
    is_external_link = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否外链')
    resource_type = Column(String(255), nullable=False, index=True, server_default=text("''"), comment='资源类型 前台reception 中台middle')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, index=True, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    organization_id = Column(INTEGER(1), nullable=False, index=True, server_default=text("'0'"), comment='组织ID')
    menu_type = Column(TINYINT(4), nullable=False, server_default=text("'0'"), comment='0菜单 1 按钮')


class PermissionMenu20201016(Base):
    __tablename__ = 'permission_menu_20201016'
    __table_args__ = (
        Index('idx_menuresourceid_isdelete_organizationid_resourcetype', 'menu_resource_id', 'is_delete', 'organization_id', 'resource_type'),
    )

    permission_menu_id = Column(INTEGER(11), primary_key=True)
    menu_resource_id = Column(String(50), nullable=False, index=True, server_default=text("''"), comment='uuid')
    name = Column(String(255), nullable=False, server_default=text("''"), comment='菜单')
    parent_permission_menu_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='父菜单ID')
    order = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='排序')
    ico = Column(String(64), nullable=False, server_default=text("''"), comment='图标')
    url = Column(String(252), nullable=False, server_default=text("''"), comment='跳转地址')
    is_external_link = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否外链')
    resource_type = Column(String(255), nullable=False, index=True, server_default=text("''"), comment='资源类型 前台reception 中台middle')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, index=True, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    organization_id = Column(INTEGER(1), nullable=False, index=True, server_default=text("'0'"), comment='组织ID')
    menu_type = Column(TINYINT(4), nullable=False, server_default=text("'0'"), comment='0菜单 1 按钮')


class PermissionMenuCopy(Base):
    __tablename__ = 'permission_menu_copy'
    __table_args__ = (
        Index('idx_menuresourceid_isdelete_organizationid_resourcetype', 'menu_resource_id', 'is_delete', 'organization_id', 'resource_type'),
    )

    permission_menu_id = Column(INTEGER(11), primary_key=True)
    menu_resource_id = Column(String(50), nullable=False, index=True, server_default=text("''"), comment='uuid')
    name = Column(String(255), nullable=False, server_default=text("''"), comment='菜单')
    parent_permission_menu_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='父菜单ID')
    order = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='排序')
    ico = Column(String(64), nullable=False, server_default=text("''"), comment='图标')
    url = Column(String(252), nullable=False, server_default=text("''"), comment='跳转地址')
    is_external_link = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否外链')
    resource_type = Column(String(255), nullable=False, index=True, server_default=text("''"), comment='资源类型 前台reception 中台middle')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, index=True, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    organization_id = Column(INTEGER(1), nullable=False, index=True, server_default=text("'0'"), comment='组织ID')


class PermissionModule(Base):
    __tablename__ = 'permission_module'

    permission_module_id = Column(INTEGER(11), primary_key=True)
    name = Column(String(255), nullable=False, server_default=text("''"), comment='模块名')
    description = Column(String(255), nullable=False, server_default=text("''"), comment='模块描述')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


t_permission_module_relationship = Table(
    'permission_module_relationship', metadata,
    Column('permission_module_id', INTEGER(11), nullable=False, server_default=text("'0'"), comment='模块名'),
    Column('company_id', INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID'),
    Column('table_id', INTEGER(11), nullable=False, server_default=text("'0'"), comment='资源ID'),
    Column('table_name', String(255), nullable=False, server_default=text("''"), comment='资源名'),
    Column('operator_employee_id', INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人'),
    Column('create_time', INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间'),
    Column('update_time', INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间'),
    Column('is_delete', TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除'),
    Column('delete_time', INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
)


class PermissionRole(Base):
    __tablename__ = 'permission_role'

    permission_role_id = Column(INTEGER(11), primary_key=True)
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    organization_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='组织ID')
    name = Column(String(255), nullable=False, server_default=text("''"), comment='角色名')
    staus = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='状态(1启用，2停用)')
    auth_apartment = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否可以查看门店(0：不可，1：可)')
    is_system = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否系统预设(0：不是，1：是)')
    parent_permission_role_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='角色父ID')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class PermissionRoleRelationship(Base):
    __tablename__ = 'permission_role_relationship'
    __table_args__ = (
        Index('idx_employeeid_isdelete_permissionroleid', 'employee_id', 'is_delete', 'permission_role_id'),
    )

    permission_role_relationship_id = Column(INTEGER(11), primary_key=True)
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    employee_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='员工ID')
    permission_role_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='角色ID')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    organization_id = Column(INTEGER(1), nullable=False, server_default=text("'0'"), comment='组织ID')


class PermissionWxapp(Base):
    __tablename__ = 'permission_wxapp'

    permission_wxapp_id = Column(INTEGER(11), primary_key=True)
    name = Column(String(64), nullable=False, server_default=text("''"), comment='小程序权限名称')
    only_code = Column(String(64), nullable=False, server_default=text("''"), comment='唯一识别码')
    organization_id = Column(String(1024), nullable=False, server_default=text("''"), comment='组织id逗号拼接，为空串则表示所有组织id')


class PerpetualCalendar(Base):
    __tablename__ = 'perpetual_calendar'

    perpetual_calendar_id = Column(INTEGER(11), primary_key=True)
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    timestamp = Column(INTEGER(11), nullable=False, comment='时间戳')
    apartment_id = Column(INTEGER(11), nullable=False, comment='公寓ID')
    room_total = Column(INTEGER(11), comment='房间总数')
    rent_total = Column(INTEGER(11), comment='出租数')
    preordain_total = Column(INTEGER(11), comment='预定数')
    surrender_total = Column(INTEGER(11), comment='退租数')


class PowerBee(Base):
    __tablename__ = 'power_bee'

    power_bee_id = Column(INTEGER(11), primary_key=True)
    sub_uuid = Column(String(100), nullable=False, comment='子账号uuid')
    apartment_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='门店ID')
    room_number = Column(String(20), nullable=False, server_default=text("''"), comment='房间编号')
    room_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='房间ID')
    power_bee_device = Column(String(100), nullable=False, server_default=text("''"), comment='电表设备号')
    c_code = Column(String(15), nullable=False, server_default=text("''"), comment='集中器编号')
    p_code = Column(String(15), nullable=False, server_default=text("''"), comment='设备编号')
    price = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='单价')
    money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='余额')
    residual_electricity = Column(DECIMAL(6, 0), nullable=False, server_default=text("'0'"), comment='剩余电量')
    switch_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='开关状态 0-断电 1-通电')
    is_online = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否在线')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')


class PowerBeeTest(Base):
    __tablename__ = 'power_bee_test'

    power_bee_id = Column(INTEGER(11), primary_key=True)
    sub_uuid = Column(String(100), nullable=False, comment='子账号uuid')
    apartment_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='门店ID')
    room_number = Column(String(20), nullable=False, server_default=text("''"), comment='房间编号')
    room_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='房间ID')
    power_bee_device = Column(String(100), nullable=False, server_default=text("''"), comment='电表设备号')
    c_code = Column(String(15), nullable=False, server_default=text("''"), comment='集中器编号')
    p_code = Column(String(15), nullable=False, server_default=text("''"), comment='设备编号')
    price = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='电价')
    money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='余额')
    residual_electricity = Column(Float(10), nullable=False, server_default=text("'0.00'"), comment='电量余额')
    switch_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='开关状态 0-断电 1-通电')
    is_online = Column(INTEGER(1), nullable=False, server_default=text("'0'"), comment='时候在线')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class Preordain(Base):
    __tablename__ = 'preordain'

    preordain_id = Column(INTEGER(11), primary_key=True, comment='主键')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    apartment_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='门店ID')
    room_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='房间ID')
    tenant_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='租客ID')
    contract_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='入住后的合同ID')
    begin_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='预定开始日')
    end_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='预定结束日')
    first_end_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='第一次结束时间')
    sales_sources_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='销售来源')
    bill_id = Column(String(64), nullable=False, index=True, server_default=text("'0'"), comment='账单表ID')
    remarks = Column(Text, comment='备注')
    money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='订金金额')
    effective_status = Column(TINYINT(1), nullable=False, index=True, server_default=text("'0'"), comment='业务生效状态;1:已生效; 2:未生效; 3:已失效; 4.租客主动取消')
    is_refund = Column(TINYINT(1), nullable=False, index=True, server_default=text("'0'"), comment='是否退款订金(1:可退;0:不可退)')
    is_rent = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否入住')
    is_unpreordain = Column(TINYINT(1), nullable=False, index=True, server_default=text("'0'"), comment='是否已退订')
    plan_number = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='计划签约数')
    pay_deposit_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='定金缴纳时间')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    safety_code = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='安全码')
    rent_free_start_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='免租期开始时间')
    rent_free_end_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='免租期结束日期')
    shortrent_card = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='短租卡卡号')
    is_sign = Column(TINYINT(4), nullable=False, server_default=text("'0'"), comment='是否签约')
    fdd_id = Column(String(100), nullable=False, server_default=text("''"), comment='法大大ID')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, index=True, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class PreordainConfig(Base):
    __tablename__ = 'preordain_config'

    preordain_config_id = Column(String(32), primary_key=True, unique=True)
    apartment_id = Column(BIGINT(20), comment='门店ID')
    public_merchant_id = Column(String(32), comment='乐乎预定金收款账户商户ID')
    public_account_type = Column(String(100), comment='乐乎账户类型:公共public,门店apartment')
    public_merchant_type = Column(TINYINT(1), server_default=text("'1'"), comment='乐乎商户号类型：1:个人 2:企业')
    public_merchant_name = Column(String(32), comment='乐乎商户别名')
    public_bank_name = Column(String(100), comment='乐乎银行名称')
    public_card_no = Column(String(32), comment='乐乎银行卡号MD5')
    apartment_merchant_id = Column(String(32), comment='甲方预定金收款账户商户ID')
    apartment_account_type = Column(String(100), comment='甲方账户类型:公共public,门店apartment')
    apartment_merchant_type = Column(TINYINT(1), server_default=text("'1'"), comment='甲方商户号类型：1:个人 2:企业')
    apartment_merchant_name = Column(String(32), comment='甲方商户别名')
    apartment_bank_name = Column(String(100), comment='甲方银行名称')
    apartment_card_no = Column(String(32), comment='甲方银行卡号MD5')
    on_account_clear_switch = Column(TINYINT(4), nullable=False, server_default=text("'1'"), comment='挂账清分开关 0=关 1=开')
    create_time = Column(INTEGER(10), server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(10), server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(10), server_default=text("'0'"))
    delete_status = Column(TINYINT(1), server_default=text("'1'"), comment='1正常，2删除')
    operator_id = Column(String(32), comment='操作员工id')


class PreordainRecord(Base):
    __tablename__ = 'preordain_record'

    preordain_record_id = Column(VARCHAR(32), primary_key=True, comment='预定记录主键ID')
    preordain_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='预定ID')
    shortrent_card = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='短租卡卡号')
    ueto_employee_id = Column(VARCHAR(50), nullable=False, server_default=text("''"), comment='上户employeeId')
    with_employee_id = Column(VARCHAR(50), nullable=False, server_default=text("''"), comment='带户employeeId')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='1正常，2已删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))


class PreordainRepair(Base):
    __tablename__ = 'preordain_repair'

    preordain_repair_id = Column(INTEGER(11), primary_key=True)
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    preordain_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='预定ID')
    room_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='房间ID')
    tenant_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='租客ID')
    bill_id = Column(String(64), nullable=False, index=True, server_default=text("'0'"), comment='账单表ID')
    remarks = Column(Text, comment='备注')
    repair_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='订金金额')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    effective_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='1有效，2未生效，3失效')


class PreordainUndo(Base):
    __tablename__ = 'preordain_undo'

    preordain_undo_id = Column(INTEGER(11), primary_key=True)
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    preordain_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='预定ID')
    bill_id = Column(String(64), nullable=False, index=True, server_default=text("'0'"), comment='账单表ID')
    tenant_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='租客ID')
    room_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='房间ID')
    remarks = Column(Text, comment='备注')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class Province(Base):
    __tablename__ = 'province'

    province_id = Column(INTEGER(11), primary_key=True, comment='省份ID')
    province_name = Column(String(20), nullable=False, server_default=text("''"), comment='名称')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    province_order = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='排序')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class PublishAlipayCommunity(Base):
    __tablename__ = 'publish_alipay_community'

    alipay_community_id = Column(INTEGER(11), primary_key=True)
    alipay_community_req_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='小区请求号')
    alipay_community_name = Column(String(32), nullable=False, server_default=text("''"), comment='小区名称')
    alipay_community_address = Column(String(32), nullable=False, server_default=text("''"), comment='小区地址')
    platform_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='平台id')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店id')
    city_name = Column(String(32), nullable=False, server_default=text("''"), comment='所在城市')
    area_name = Column(String(64), nullable=False, server_default=text("''"), comment='所在城市区域')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class PublishAlipayImgUrl(Base):
    __tablename__ = 'publish_alipay_img_url'

    alipay_img_url_id = Column(INTEGER(11), primary_key=True)
    room_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='房间ID')
    room_color_configuration_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='房间主题id')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店id')
    platform_id = Column(INTEGER(11), nullable=False, comment='平台id')
    alipay_img_url = Column(String(255), nullable=False, server_default=text("''"), comment='图片链接地址')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class PublishAlipayRoomFrame(Base):
    __tablename__ = 'publish_alipay_room_frame'

    alipay_room_frame_id = Column(INTEGER(11), primary_key=True)
    room_color_configuration_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='房间主题ID')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店id')
    platform_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='平台id')
    room_status = Column(TINYINT(1), nullable=False, comment='是否上架; 0:下架; 1:上架')
    room_code = Column(String(32), nullable=False, server_default=text("''"), comment='é“¾å®¶éœ€è¦\x81çš„room_code')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class PublishAlipaySync(Base):
    __tablename__ = 'publish_alipay_sync'

    alipay_sync_id = Column(INTEGER(11), primary_key=True)
    room_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='房间ID')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店id')
    platform_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='平台id')
    room_status = Column(TINYINT(1), nullable=False, comment='是否上架; 0:下架; 1:上架')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class PublishCcbApartment(Base):
    __tablename__ = 'publish_ccb_apartment'

    id = Column(INTEGER(11), primary_key=True)
    ccb_apartment_id = Column(String(32), nullable=False, server_default=text("''"), comment='门店表业务id')
    city_code = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='建信家园城市code')
    apartment_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='乐乎门店id')
    community_code = Column(String(36), nullable=False, index=True, server_default=text("''"), comment='建信家园小区对齐id')
    apartment_code = Column(String(36), nullable=False, server_default=text("''"), comment='建信家园门店id')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否删除; 1:正常; 2:删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class PublishCcbBill(Base):
    __tablename__ = 'publish_ccb_bill'

    id = Column(INTEGER(11), primary_key=True, comment='自增id')
    ccb_bill_id = Column(String(32), nullable=False, server_default=text("''"), comment='业务id')
    source_contract_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='乐乎合同id')
    service_code = Column(String(16), nullable=False, server_default=text("''"), comment='业务code')
    bill_id = Column(String(32), nullable=False, index=True, server_default=text("'0'"), comment='乐乎账单id')
    bill_code = Column(String(36), nullable=False, index=True, server_default=text("''"), comment='建信账单编号')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否删除; 1:正常; 2:删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class PublishCcbCommunity(Base):
    __tablename__ = 'publish_ccb_community'

    id = Column(INTEGER(11), primary_key=True)
    ccb_community_id = Column(String(32), nullable=False, server_default=text("''"), comment='小区对齐业务id')
    apartment_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='乐乎门店id')
    community_code = Column(String(36), nullable=False, index=True, server_default=text("''"), comment='建信家园小区对齐id')
    community_name = Column(String(64), nullable=False, index=True, server_default=text("''"), comment='建信家园小区名称(百度小区名称)')
    community_addr = Column(String(64), nullable=False, server_default=text("''"), comment='建信家园小区地址(百度小区地址)')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否删除; 1:正常; 2:删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class PublishCcbContract(Base):
    __tablename__ = 'publish_ccb_contract'

    id = Column(INTEGER(11), primary_key=True, comment='自增id')
    ccb_contract_id = Column(String(32), nullable=False, server_default=text("''"), comment='业务id')
    contract_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='乐乎合同id')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='乐乎门店id')
    room_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='乐乎房间id')
    contract_code = Column(String(36), nullable=False, index=True, server_default=text("''"), comment='建信系统合同编号')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否删除; 1:正常; 2:删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class PublishCcbImage(Base):
    __tablename__ = 'publish_ccb_image'

    id = Column(INTEGER(11), primary_key=True)
    ccb_image_id = Column(String(32), nullable=False, server_default=text("''"), comment='门店图片业务id')
    source_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='来源id; 门店id,房型id')
    source_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='来源类型: 1:门店; 2:房型')
    image_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='图片类型: 1:封面图; 2:介绍图')
    image_title = Column(String(8), nullable=False, server_default=text("''"), comment='图片标题')
    image_url = Column(String(255), nullable=False, index=True, comment='建信家园返回的图片URL')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否删除; 1:正常; 2:删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class PublishCcbPreordain(Base):
    __tablename__ = 'publish_ccb_preordain'

    id = Column(INTEGER(11), primary_key=True, comment='自增id')
    ccb_preordain_id = Column(String(32), nullable=False, server_default=text("''"), comment='业务id')
    preordain_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='乐乎预定id')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='乐乎门店id')
    room_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='乐乎房间id')
    preordain_code = Column(String(36), nullable=False, index=True, server_default=text("''"), comment='建信系统预定编号')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否删除; 1:正常; 2:删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class PublishCcbRoom(Base):
    __tablename__ = 'publish_ccb_room'

    id = Column(INTEGER(11), primary_key=True)
    ccb_room_id = Column(String(32), nullable=False, server_default=text("''"), comment='房间表业务id')
    apartment_id = Column(INTEGER(11), nullable=False, comment='乐乎门店id')
    room_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='乐乎房间表id')
    room_code = Column(String(36), nullable=False, index=True, server_default=text("''"), comment='建信家园房间id')
    room_type_code = Column(String(36), nullable=False, index=True, server_default=text("''"), comment='建信家园房型id')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否删除; 1:正常; 2:删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class PublishCcbRoomType(Base):
    __tablename__ = 'publish_ccb_room_type'

    id = Column(INTEGER(11), primary_key=True)
    ccb_room_type_id = Column(String(32), nullable=False, server_default=text("''"), comment='房型表业务id')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='乐乎门店id')
    apartment_code = Column(String(36), nullable=False, index=True, server_default=text("''"), comment='建信家园门店id')
    room_type_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='乐乎房型id')
    room_type_code = Column(String(36), nullable=False, index=True, server_default=text("''"), comment='建信家园房型id')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否删除; 1:正常; 2:删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class PublishLianjiaAccount(Base):
    __tablename__ = 'publish_lianjia_account'

    lianjia_account_id = Column(INTEGER(11), primary_key=True)
    city_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='城市ID')
    account = Column(String(32), nullable=False, server_default=text("''"), comment='账户')
    password = Column(String(32), nullable=False, server_default=text("''"), comment='密码')
    service_phone = Column(String(11), nullable=False, server_default=text("''"), comment='服务人员电话')
    current_login = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='当前登录; 0:未登录;1:已登录')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class PublishLianjiaApartment(Base):
    __tablename__ = 'publish_lianjia_apartment'

    lianjia_apartment_id = Column(INTEGER(11), primary_key=True)
    apartment_id = Column(INTEGER(11), nullable=False, comment='门店id')
    apartment_code = Column(String(32), nullable=False, server_default=text("''"), comment='门店code')
    brand_code = Column(String(32), nullable=False, server_default=text("''"), comment='品牌code')
    city_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='城市id')
    publish_city_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='当前发布城市')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class PublishLianjiaBrand(Base):
    __tablename__ = 'publish_lianjia_brand'

    lianjia_brand_id = Column(INTEGER(11), primary_key=True)
    brand_code = Column(String(32), nullable=False, server_default=text("''"), comment='品牌code')
    platform_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='平台id')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class PublishLianjiaRoom(Base):
    __tablename__ = 'publish_lianjia_room'

    lianjia_room_id = Column(INTEGER(11), primary_key=True)
    room_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='房间ID')
    room_code = Column(String(32), nullable=False, server_default=text("''"), comment='房间code')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店id')
    lianjia_room_frame_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='房型id')
    is_publish = Column(TINYINT(1), nullable=False, comment='是否上架; 0:下架; 1:上架')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class PublishLianjiaRoomFrame(Base):
    __tablename__ = 'publish_lianjia_room_frame'

    lianjia_room_frame_id = Column(INTEGER(11), primary_key=True)
    apartment_id = Column(INTEGER(11), nullable=False, comment='门店id')
    room_frame_code = Column(String(32), nullable=False, server_default=text("''"), comment='链家房型code')
    room_color_configuration_id = Column(INTEGER(11), nullable=False, comment='房间颜色配置id')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class PublishPlatform(Base):
    __tablename__ = 'publish_platform'

    platform_id = Column(INTEGER(11), primary_key=True)
    platform_name = Column(String(255), nullable=False, server_default=text("''"), comment='平台名称')
    platform_code = Column(String(64), nullable=False, server_default=text("''"), comment='平台码')
    access_token = Column(String(255), nullable=False, server_default=text("''"), comment='令牌')
    expire_time = Column(String(13), nullable=False, server_default=text("''"), comment='令牌过期时间')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class PublishPlatformAction(Base):
    __tablename__ = 'publish_platform_action'

    platform_action_id = Column(INTEGER(11), primary_key=True)
    user_id = Column(String(32), nullable=False, server_default=text("'0'"), comment='平台用户id')
    tenant_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='ç§Ÿå®¢id')
    zhima_openid = Column(String(64), nullable=False, server_default=text("''"), comment='芝麻信用openid')
    platform_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='平台id')
    room_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='房间id')
    room_color_configuration_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='房间颜色配置id')
    flat_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='公寓类型: 1:分散式; 2: 集中式')
    action_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='平台用户执行动作时间(预约看房, 拨号记录)')
    action_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='动作类型; 1:预约看房; 2:拨号记录;')
    card_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='证件类型; 0:身份证;')
    card_no = Column(String(128), nullable=False, server_default=text("'0'"), comment='证件号码;')
    remarks = Column(Text, comment='租客描述')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class QuantityStatistic(Base):
    __tablename__ = 'quantity_statistics'

    quantity_statistics_id = Column(INTEGER(11), primary_key=True, comment='当量统计ID')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    ueto_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='上户员工ID')
    with_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='带户员工ID')
    preordain_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='预定表 ID')
    room_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='房间 ID 用于区分重新排房')
    ueto_quantity = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='上户单量')
    with_quantity = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='带户单量')
    contract_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='销售直接签约时合同 ID')
    custom_ueto_quantity = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='客户池上户单量')
    custom_with_quantity = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='客户池带户单量')
    calc_order_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='计单日期')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除 0 未删，1 已删')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class Queue(Base):
    __tablename__ = 'queue'

    id = Column(String(32), primary_key=True, server_default=text("''"))
    runtime = Column(BIGINT(13), nullable=False, comment='运行时间')
    callback = Column(String(255), nullable=False, server_default=text("''"), comment='回调地址')
    method = Column(String(11), nullable=False, server_default=text("''"), comment='回调请求方式')
    data = Column(Text, nullable=False, comment='回调请求参数')
    status = Column(INTEGER(11), nullable=False, comment='状态')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class RealNameAuth(Base):
    __tablename__ = 'real_name_auth'

    real_name_auth_id = Column(INTEGER(11), primary_key=True)
    tenant_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='租客ID')
    name = Column(String(30), nullable=False, server_default=text("''"), comment='姓名')
    id_card_md5 = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='身份证MD5')
    id_card = Column(LargeBinary, nullable=False, comment='身份证号')
    sex = Column(TINYINT(3), nullable=False, server_default=text("'1'"), comment='性别1-男 2-女')
    front_img = Column(String(255), nullable=False, server_default=text("''"), comment='正面图片')
    front_json = Column(MEDIUMTEXT, comment='正面数据')
    back_img = Column(String(255), nullable=False, server_default=text("''"), comment='背面图片')
    back_json = Column(MEDIUMTEXT, comment='背面数据')
    hold_img = Column(String(255), nullable=False, server_default=text("''"), comment='手持图片')
    is_real = Column(TINYINT(3), nullable=False, server_default=text("'0'"), comment='是否实名认证')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    autograph_url = Column(String(128), nullable=False, server_default=text("''"), comment='签名地址')


class RecordsBjPlot(Base):
    __tablename__ = 'records_bj_plot'

    plot_id = Column(INTEGER(11), primary_key=True)
    id = Column(INTEGER(11), nullable=False, comment='小区编号')
    modify_seq_no = Column(INTEGER(11), comment='更新序列号')
    rent_status = Column(INTEGER(4), comment='出租状态')
    district_id = Column(INTEGER(11), comment='所在区县')
    title = Column(String(255), comment='小区名称')
    other_titles = Column(String(1000), comment='小区别名')
    address = Column(String(1000))
    cert_address = Column(String(1000), comment='权证地址')
    lng = Column(DECIMAL(12, 6), comment='经度')
    lat = Column(DECIMAL(12, 6), comment='维度')
    rent_description = Column(String(1000), comment='出租描述')


class RecordsHzUploadLog(Base):
    __tablename__ = 'records_hz_upload_log'

    upload_id = Column(INTEGER(11), primary_key=True)
    apartment_id = Column(INTEGER(10), nullable=False, comment='门店id')
    success_count = Column(INTEGER(10), server_default=text("'0'"), comment='成功数量')
    fail_count = Column(INTEGER(10), comment='失败数量')
    create_time = Column(INTEGER(10), comment='创建时间')
    update_time = Column(INTEGER(10), comment='修改时间')
    delete_time = Column(INTEGER(10), comment='删除时间')
    delete_status = Column(INTEGER(1), comment='删除状态')


class RecordsLandlordInfo(Base):
    __tablename__ = 'records_landlord_info'

    id = Column(INTEGER(11), primary_key=True)
    landlord_id = Column(String(32), nullable=False, comment='出租人id')
    apartment_id = Column(INTEGER(32), unique=True)
    if_owner = Column(INTEGER(2), nullable=False, comment='是否房主')
    landlord_type = Column(INTEGER(2), nullable=False, server_default=text("'0'"), comment='单位或个人')
    landlord_title = Column(String(255), nullable=False, server_default=text("''"), comment='名称')
    card_type = Column(INTEGER(2), nullable=False, server_default=text("'0'"), comment='证件类型')
    card_name = Column(String(255), nullable=False, server_default=text("''"), comment='证件名称')
    card_no = Column(LargeBinary, comment='证件号码')
    card_no_md5 = Column(String(128), server_default=text("''"))
    mobile = Column(LargeBinary, comment='联系电话')
    mobile_md5 = Column(String(128), server_default=text("''"))
    create_time = Column(INTEGER(10), nullable=False)
    update_time = Column(INTEGER(10), nullable=False)
    delete_time = Column(INTEGER(10), nullable=False)
    delete_status = Column(INTEGER(4), nullable=False, server_default=text("'0'"), comment='删除状态')


class RecordsOwnershipInfo(Base):
    __tablename__ = 'records_ownership_info'

    id = Column(INTEGER(11), primary_key=True)
    ownership_id = Column(String(32), nullable=False, comment='主键id')
    apartment_id = Column(INTEGER(10), nullable=False, unique=True, comment='门店id')
    cert_type = Column(INTEGER(2), server_default=text("'0'"), comment='权属证明类别')
    cert_description = Column(String(255), comment='证件描述（证件类型为用地批文等类型时使用）')
    cert_no = Column(String(128), server_default=text("''"), comment='权属证书编号')
    owner_type = Column(INTEGER(1), server_default=text("'0'"), comment='持证人类别')
    owner_name = Column(String(255), server_default=text("''"), comment='持证人名称')
    owner_card_type = Column(INTEGER(1), server_default=text("'0'"), comment='持证人证件类别')
    owner_card_no = Column(LargeBinary, comment='持证人证件号码')
    owner_card_no_md5 = Column(String(128), server_default=text("''"))
    house_code = Column(String(32), server_default=text("''"), comment='房屋编号（建委）')
    district_code = Column(String(16), server_default=text("''"), comment='房屋所在区县')
    address = Column(String(512), server_default=text("''"), comment='房屋坐落')
    design_usage = Column(String(255), server_default=text("''"), comment='规划用途')
    if_residence = Column(INTEGER(1), server_default=text("'0'"), comment='是否住宅')
    build_area = Column(DECIMAL(8, 2), server_default=text("'0.00'"), comment='建筑面积')
    results_content = Column(String(2000), server_default=text("''"), comment='第三方接口返回数据（多个接口通过key:value的方式存储）')
    audit_status = Column(INTEGER(1), server_default=text("'0'"), comment='核验状态')
    create_time = Column(INTEGER(10), nullable=False)
    update_time = Column(INTEGER(10), nullable=False)
    delete_time = Column(INTEGER(10), nullable=False)
    delete_status = Column(INTEGER(4), nullable=False, server_default=text("'0'"), comment='删除状态')


class Refund(Base):
    __tablename__ = 'refund'

    refund_id = Column(INTEGER(11), primary_key=True)
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    bill_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='账单ID')
    bank_account_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='核销账户')
    bank_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='银行存款')
    cash_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='退款现金')
    post_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='入账时间')
    finance_sequence_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='财务流水ID')
    document_number = Column(String(255), nullable=False, comment='核销单据号')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class RegionRelation(Base):
    __tablename__ = 'region_relation'

    region_relation_id = Column(INTEGER(11), primary_key=True, comment='主键ID')
    company_region_id = Column(String(32), nullable=False, server_default=text("''"), comment='公司区域id')
    region = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='1:华北，2:华南，3华东')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='更新时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间')


class Reminder(Base):
    __tablename__ = 'reminder'

    reminder_id = Column(INTEGER(11), primary_key=True)
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    reminder_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='催缴时间')
    contract_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='催缴的合同')
    sms_content = Column(Text)
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    bill_id = Column(String(100), nullable=False, server_default=text("''"), comment='账单id')
    room_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='房间id')
    tenant_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='租客id')
    end_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='最晚交租时间')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店id')


class ReminderRemark(Base):
    __tablename__ = 'reminder_remark'

    id = Column(INTEGER(11), primary_key=True)
    reminder_remark_id = Column(String(100), nullable=False, server_default=text("''"), comment='uuid\\n')
    bill_id = Column(String(100), nullable=False, server_default=text("''"), comment='账单id')
    content = Column(Text, nullable=False, comment='备注')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"))


class RenewalReasonRelation(Base):
    __tablename__ = 'renewal_reason_relation'

    renewal_reason_relation_id = Column(INTEGER(11), primary_key=True)
    renewal_routine_reason_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='拒绝原因ID')
    renewal_routine_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='续租申请ID')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class RenewalRoutine(Base):
    __tablename__ = 'renewal_routine'

    renewal_routine_id = Column(INTEGER(11), primary_key=True)
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    room_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='房间ID')
    old_contract_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='续租老合同ID')
    old_contract_end_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='老合同结束时间')
    fdd_contract_id = Column(String(32), server_default=text("''"), comment='法大大合同ID')
    new_contract_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='续租新合同ID')
    rental = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='房间定价与周期系数的结果')
    deposit_month = Column(TINYINT(2), nullable=False, server_default=text("'0'"), comment='续租新合同押金支付月份')
    rent_month = Column(TINYINT(2), nullable=False, server_default=text("'0'"), comment='续租新合同租金支付月份')
    contract_cycle = Column(TINYINT(2), nullable=False, server_default=text("'0'"), comment='续租新合同合同周期（月份）')
    from_way = Column(TINYINT(2), nullable=False, server_default=text("'0'"), comment='以支付中心为准')
    sale_group_leader_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='组长id')
    begin_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='续租新合同开始日期')
    end_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='续租新合同结束日期')
    discount_scale = Column(DECIMAL(6, 4), nullable=False, comment='续租新合同租金周期系数')
    finance_scale = Column(DECIMAL(6, 4), nullable=False, comment='续租新合同租金季付系数')
    ious_scale = Column(DECIMAL(6, 4), nullable=False, comment='续租新合同租金分期系数')
    is_ious = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='续租新合同是否月付')
    ueto_employee_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='受理管家(上户)')
    rr_status = Column(TINYINT(3), nullable=False, server_default=text("'0'"), comment='处理状态0:未审核 10:管家受理 20: 订单已推送待租客确认 30：管家取消 40:租客已确认 50:异常')
    employee_confirm_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='管家受理时间')
    tenant_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='申请租客')
    tenant_confirm_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='租客确认时间')
    tenant_confirm_url = Column(String(100), nullable=False, server_default=text("''"), comment='管家确定url')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class RenewalRoutineLog(Base):
    __tablename__ = 'renewal_routine_log'

    rrl_id = Column(INTEGER(11), primary_key=True)
    renewal_routine_id = Column(INTEGER(11), index=True, server_default=text("'0'"), comment='续租申请ID')
    rrl_type = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='操作类型1:管家 2:租客')
    rrl_before_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='变化前状态')
    rrl_after_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='变化后状态')
    operator_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人ID(租客、员工)')
    remarks = Column(String(255), server_default=text("''"), comment='备注')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class RenewalRoutineReason(Base):
    __tablename__ = 'renewal_routine_reason'

    renewal_routine_reason_id = Column(INTEGER(11), primary_key=True)
    reason = Column(String(255), nullable=False, server_default=text("''"), comment='拒绝原因')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class Renewal(Base):
    __tablename__ = 'renewals'

    renewals_id = Column(INTEGER(11), primary_key=True)
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    is_rent = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否是租金(0:是非收租;1:收租)')
    bill_id = Column(String(64), nullable=False, index=True, server_default=text("'0'"), comment='账单ID')
    room_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='房间id')
    contract_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='合同ID')
    money = Column(DECIMAL(10, 2), nullable=False, comment='续费金额')
    discount = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='租金折扣比例')
    paid_start_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='续费开始日')
    how_pay = Column(TINYINT(2), nullable=False, server_default=text("'0'"), comment='付几月')
    how_day = Column(TINYINT(3), nullable=False, server_default=text("'0'"), comment='付几天')
    remarks = Column(Text, comment='备注信息')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    is_repair = Column(TINYINT(1), nullable=False, server_default=text("'2'"), comment='是否修复记账单; 0:未知,1:已修复; 2:未修复')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class RenewalsPlan(Base):
    __tablename__ = 'renewals_plan'

    renewals_plan_id = Column(INTEGER(11), primary_key=True)
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    contract_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='合同ID')
    plan_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='续费时间')
    remarks = Column(Text, comment='备注')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class ReparationConfiguration(Base):
    __tablename__ = 'reparation_configuration'

    reparation_configuration_id = Column(INTEGER(11), primary_key=True)
    reparation_configuration_name = Column(String(100), nullable=False, server_default=text("''"), comment='赔偿名')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class ReservationSurrender(Base):
    __tablename__ = 'reservation_surrender'

    reservation_surrender_id = Column(INTEGER(11), primary_key=True)
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    room_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='房间ID')
    contract_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='合同ID')
    bill_id = Column(String(64), nullable=False, server_default=text("'0'"), comment='账单id')
    reservation_surrender_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='预退时间')
    remarks = Column(Text, comment='备注')
    reservation_surrender_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='预退类型(0:待退租;1:已退;2:已取消)')
    entrust_surrender = Column(TINYINT(3), nullable=False, server_default=text("'0'"), comment='是否委托转租')
    type_source = Column(Enum('lisa', 'mobile', 'app'), nullable=False, server_default=text("'lisa'"), comment='预退来源; lisa:Lisa; mobile:M站; app:APP')
    is_pay = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否支付; 0:未支付; 1:已支付;')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    reservation_surrender_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='预退类型: 1 托转; 2 自传; 3 到期退租; 4 续租')


class Ridgepole(Base):
    __tablename__ = 'ridgepole'

    ridgepole_id = Column(INTEGER(11), primary_key=True)
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公寓ID')
    ridgepole_number = Column(String(20), nullable=False, server_default=text("''"), comment='楼栋编号')
    ridgepole_name = Column(String(20), nullable=False, server_default=text("''"), comment='楼栋名')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class RoleRoleRelation(Base):
    __tablename__ = 'role_role_relation'

    role_role_relation_id = Column(INTEGER(11), primary_key=True)
    organization_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='组织ID')
    master_role_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='主角色ID')
    role_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='角色ID')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class Room(Base):
    __tablename__ = 'room'

    room_id = Column(INTEGER(11), primary_key=True)
    unique_id = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='唯一不重复id')
    house_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"))
    company_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='公司ID')
    room_template_id = Column(INTEGER(11), nullable=False, comment='房间模板ID')
    room_number = Column(VARCHAR(20), nullable=False, index=True, server_default=text("''"), comment='房间编号')
    apartment_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='公寓ID')
    ridgepole_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='楼栋ID')
    floor_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='楼层ID')
    orientations = Column(VARCHAR(20), nullable=False, server_default=text("''"), comment='朝向')
    area = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='面积')
    color = Column(VARCHAR(36), nullable=False, server_default=text("' '"), comment='颜色')
    room_color_configuration_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='颜色配置id')
    advance_pay_rent_day = Column(TINYINT(2), nullable=False, server_default=text("'0'"), comment='提前缴租天数')
    rental = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='租金')
    fix_price = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='房间定价')
    is_preordain = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否预定')
    is_lock = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否锁定 锁定不能预订和入住')
    is_reservation_surrender = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否预退')
    reservation_surrender_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='预退时间')
    is_rent = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否出租（0：未出租；1：已出租）')
    is_disable = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否停用')
    is_new = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否是新房间')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    new_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新房时间')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, index=True, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    disable_type = Column(TINYINT(1), nullable=False, server_default=text("'3'"), comment='停用类型(0:装修房;1:维修房;2:宿舍库房等;4:房间永久停用)')
    delivery_id = Column(VARCHAR(36), nullable=False, server_default=text("' '"), comment='批次主键')
    delivery_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='批次时间')
    opening_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否开业(1是,0否)')
    opening_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='开业时间')
    is_dirty = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否脏房')


class RoomAreaConfiguration(Base):
    __tablename__ = 'room_area_configuration'

    room_area_configuration_id = Column(INTEGER(11), primary_key=True, comment='房间面积配置id')
    apartment_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='门店id')
    area = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='面积')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='更新时间')
    is_delete = Column(TINYINT(3), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class RoomColorConfiguration(Base):
    __tablename__ = 'room_color_configuration'

    room_color_configuration_id = Column(INTEGER(11), primary_key=True, comment='房间颜色配置id')
    unique_id = Column(String(32), nullable=False, server_default=text("''"), comment='唯一编码')
    color_name = Column(String(64), nullable=False, server_default=text("' '"), comment='颜色名称')
    alias_name = Column(String(64), nullable=False, server_default=text("' '"), comment='颜色别名')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='更新时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间')


class RoomConfiguration(Base):
    __tablename__ = 'room_configuration'

    room_configuration_id = Column(INTEGER(11), primary_key=True)
    room_configuration_name = Column(String(20), nullable=False, server_default=text("''"), comment='房间配置名称')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


t_room_configuration_relationship = Table(
    'room_configuration_relationship', metadata,
    Column('room_id', INTEGER(11), nullable=False, server_default=text("'0'"), comment='房间ID'),
    Column('company_id', INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID'),
    Column('room_configuration_id', INTEGER(11), nullable=False, server_default=text("'0'"), comment='房间配置ID'),
    Column('operator_employee_id', INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人'),
    Column('create_time', INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间'),
    Column('update_time', INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间'),
    Column('is_delete', TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除'),
    Column('delete_time', INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
)


class RoomDelivery(Base):
    __tablename__ = 'room_delivery'

    room_delivery_id = Column(String(32), primary_key=True, server_default=text("''"), comment='房间交付id')
    delivery_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='交房时间')
    apartment_id = Column(String(32), comment='门店主键')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(4), server_default=text("'0'"), comment='删除状态(1:未删除,1:已删除)')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class RoomDisable(Base):
    __tablename__ = 'room_disable'

    room_disable_id = Column(INTEGER(11), primary_key=True)
    company_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='公司ID')
    room_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='房间ID')
    disable_type = Column(TINYINT(1), nullable=False, index=True, server_default=text("'0'"), comment='停用类型(0:装修房;1:维修房;2:宿舍库房等;3:房间被开启;4:房间永久停用)')
    begin_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='停用开始时间')
    end_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='停用结束时间')
    remarks = Column(Text, comment='停用备注信息')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class RoomDisableAppraise(Base):
    __tablename__ = 'room_disable_appraise'

    room_disable_appraise_id = Column(INTEGER(11), primary_key=True)
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    room_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='房间ID')
    begin_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='停用考核开始时间')
    end_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='停用考核结束时间')
    remarks = Column(Text, comment='停用考核备注信息')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


t_room_disable_type = Table(
    'room_disable_type', metadata,
    Column('room_id', INTEGER(11), server_default=text("'0'")),
    Column('room_template_id', INTEGER(11)),
    Column('room_number', String(20)),
    Column('apartment_id', INTEGER(11), server_default=text("'0'")),
    Column('ridgepole_id', INTEGER(11), server_default=text("'0'")),
    Column('floor_id', INTEGER(11), server_default=text("'0'")),
    Column('orientations', String(20)),
    Column('advance_pay_rent_day', TINYINT(2), server_default=text("'0'")),
    Column('rental', DECIMAL(10, 2), server_default=text("'0.00'")),
    Column('is_preordain', TINYINT(1), server_default=text("'0'")),
    Column('is_reservation_surrender', TINYINT(1), server_default=text("'0'")),
    Column('reservation_surrender_time', INTEGER(10), server_default=text("'0'")),
    Column('is_rent', TINYINT(1), server_default=text("'0'")),
    Column('is_disable', TINYINT(1), server_default=text("'0'")),
    Column('is_new', TINYINT(1), server_default=text("'0'")),
    Column('operator_employee_id', INTEGER(11), server_default=text("'0'")),
    Column('new_time', INTEGER(11), server_default=text("'0'")),
    Column('create_time', INTEGER(11), server_default=text("'0'")),
    Column('update_time', INTEGER(11), server_default=text("'0'")),
    Column('is_delete', TINYINT(1), server_default=text("'0'")),
    Column('delete_time', INTEGER(11), server_default=text("'0'")),
    Column('disable_type', TINYINT(1), server_default=text("'0'")),
    Column('begin_time', INTEGER(11), server_default=text("'0'")),
    Column('end_time', INTEGER(11), server_default=text("'0'"))
)


class RoomLock(Base):
    __tablename__ = 'room_lock'

    room_lock_id = Column(INTEGER(11), primary_key=True)
    company_id_back = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    room_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='房间ID')
    operator_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作者ID')
    operator_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='操作者类型 1 租客 2 员工')
    table_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='锁定类型ID')
    table_name = Column(String(64), nullable=False, server_default=text("''"), comment='锁定类型')
    remarks = Column(Text, comment='锁定备注信息')
    begin_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='锁定开始时间')
    end_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='锁定结束时间')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class RoomLog(Base):
    __tablename__ = 'room_log'

    room_log_id = Column(INTEGER(11), primary_key=True)
    room_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='房间id')
    house_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"))
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    room_template_id = Column(INTEGER(11), nullable=False, comment='房间模板ID')
    room_number = Column(String(20), nullable=False, server_default=text("''"), comment='房间编号')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公寓ID')
    ridgepole_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='楼栋ID')
    floor_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='楼层ID')
    orientations = Column(String(20), nullable=False, server_default=text("''"), comment='朝向')
    area = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='面积')
    color = Column(String(36), nullable=False, server_default=text("' '"), comment='颜色')
    advance_pay_rent_day = Column(TINYINT(2), nullable=False, server_default=text("'0'"), comment='提前缴租天数')
    rental = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='租金')
    front_rental = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='修改前金额')
    is_preordain = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否预定')
    is_reservation_surrender = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否预退')
    reservation_surrender_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='预退时间')
    is_rent = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否出租（0：未出租；1：已出租）')
    is_disable = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否停用')
    is_new = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否是新房间')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    new_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新房时间')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class RoomOrientation(Base):
    __tablename__ = 'room_orientations'

    room_orientations_id = Column(INTEGER(11), primary_key=True)
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    room_orientations_name = Column(String(20), nullable=False, server_default=text("''"), comment='房间朝向名称')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class RoomRentLog(Base):
    __tablename__ = 'room_rent_log'

    rent_log_id = Column(INTEGER(11), primary_key=True)
    city_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='城市ID')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    room_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='房间ID')
    room_number = Column(String(20), nullable=False, server_default=text("''"), comment='房间编号')
    year_2015 = Column(MEDIUMTEXT, comment='年份')
    year_2016 = Column(MEDIUMTEXT, comment='年份')
    year_2017 = Column(MEDIUMTEXT, comment='年份')
    year_2018 = Column(MEDIUMTEXT, comment='年份')
    year_2019 = Column(MEDIUMTEXT, comment='年份')
    year_2020 = Column(MEDIUMTEXT, comment='年份')
    year_2021 = Column(MEDIUMTEXT, comment='年份')
    year_2022 = Column(MEDIUMTEXT, comment='年份')
    year_2023 = Column(MEDIUMTEXT, comment='年份')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class RoomRentOperateLog(Base):
    __tablename__ = 'room_rent_operate_log'

    room_rent_operate_log_id = Column(INTEGER(11), primary_key=True)
    room_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='房间ID')
    table_name = Column(String(100), nullable=False, server_default=text("''"), comment='产生房间日志的表名称（系统操作）')
    table_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='产生房间日志的表ID（系统操作）')
    start_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='开始时间')
    end_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='结束时间')
    type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='操作类型（1：在住，2：未住）')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人（人为操作）')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class RoomSwitch(Base):
    __tablename__ = 'room_switch'

    room_switch_id = Column(INTEGER(11), primary_key=True, comment='换房ID')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    old_contract_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='老合同ID')
    contract_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='新合同ID')
    bill_id = Column(String(64), nullable=False, index=True, server_default=text("'0'"), comment='账单表ID')
    is_reparation = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否赔偿')
    is_ious = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否是月付换房')
    reparation_configuration_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='赔偿类型ID')
    reparation_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='赔偿金额')
    rental = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='退步的租金')
    rental_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='租金退步类型(0:收;1:退)')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class RoomTemplate(Base):
    __tablename__ = 'room_template'

    room_template_id = Column(INTEGER(11), primary_key=True)
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    room_template_name = Column(String(11), nullable=False, server_default=text("''"), comment='房间模板名称')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公寓ID')
    rental = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='租金')
    orientations = Column(String(20), nullable=False, server_default=text("''"), comment='朝向')
    advance_pay_rent_day = Column(TINYINT(2), nullable=False, server_default=text("'0'"), comment='提前缴租天数')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


t_room_template_configuration_relationship = Table(
    'room_template_configuration_relationship', metadata,
    Column('room_template_id', INTEGER(11), nullable=False, server_default=text("'0'"), comment='房间模板ID'),
    Column('company_id', INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID'),
    Column('room_configuration_id', INTEGER(11), nullable=False, server_default=text("'0'"), comment='房间配置ID'),
    Column('operator_employee_id', INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人'),
    Column('create_time', INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间'),
    Column('update_time', INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间'),
    Column('is_delete', TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除'),
    Column('delete_time', INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
)


class RuleCategory(Base):
    __tablename__ = 'rule_category'

    rule_category_id = Column(String(32), primary_key=True)
    rule_name = Column(String(50), nullable=False, server_default=text("''"), comment='提成规则分组名称')
    operation_user_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='操作人id')
    sort = Column(String(50), comment='规则内容的字段   example :     start_count.desc  -> 按照start_count 降序排列')
    rule_type = Column(INTEGER(1), nullable=False, server_default=text("'1'"), comment='分组类型： 1：默认规则，2：自定义规则')
    delete_status = Column(INTEGER(1), nullable=False, server_default=text("'1'"), comment='删除状态：1存在2删除')
    delete_time = Column(INTEGER(10), server_default=text("'0'"), comment='删除时间： 10位时间戳')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='创建时间：10位时间戳')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='最后一次修改时间：10位时间戳')
    house_hold_money = Column(DECIMAL(12, 2), nullable=False, server_default=text("'0.00'"), comment='固定带户提成金额')
    renewing_money = Column(DECIMAL(12, 2), nullable=False, server_default=text("'0.00'"), comment='固定续租提成金额')
    organization_id = Column(String(32), server_default=text("'0'"), comment='organization_id')


class SalesPurpose(Base):
    __tablename__ = 'sales_purpose'

    id = Column(INTEGER(11), primary_key=True, comment='主键')
    sp_year = Column(INTEGER(11), nullable=False, comment='年')
    sp_month = Column(INTEGER(11), server_default=text("'1'"), comment='月')
    sp_day = Column(INTEGER(11), server_default=text("'1'"), comment='日')
    slot1 = Column(INTEGER(11), comment='北京')
    slot2 = Column(INTEGER(11), comment='上海')
    slot3 = Column(INTEGER(11), comment='广州')
    slot4 = Column(INTEGER(11), comment='深圳')
    slot5 = Column(INTEGER(11), comment='成都')
    slot6 = Column(INTEGER(11), comment='武汉')
    slot7 = Column(INTEGER(11), comment='杭州')
    slot8 = Column(INTEGER(11), comment='南京')
    slot9 = Column(INTEGER(11), comment='位置')
    slot10 = Column(INTEGER(11), comment='位置')
    delete_status = Column(INTEGER(11), nullable=False, server_default=text("'1'"), comment='删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class SalesSource(Base):
    __tablename__ = 'sales_sources'

    sales_sources_id = Column(INTEGER(11), primary_key=True)
    sales_sources_name = Column(String(20), nullable=False, server_default=text("''"), comment='销售渠道名称')
    is_display = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否显示')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class SalesTarget(Base):
    __tablename__ = 'sales_target'

    sales_target_id = Column(String(32), primary_key=True, comment='id')
    city_id = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='城市id')
    city_name = Column(String(50), nullable=False, server_default=text("'0'"), comment='城市名')
    type_id = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='目标分类  1:月目标 2:日目标')
    target_day = Column(DateTime, nullable=False, index=True, comment='目标日')
    volume = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='目标销量')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class SalesTargetRecord(Base):
    __tablename__ = 'sales_target_record'

    sales_target_record = Column(String(32), primary_key=True)
    operation_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人编号')
    operation_employee_name = Column(String(50), nullable=False, server_default=text("'0'"), comment='操作人姓名')
    detail = Column(Text, nullable=False, comment='修改内容')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class SceneApartmentContractTemplateConf(Base):
    __tablename__ = 'scene_apartment_contract_template_conf'

    scene_apartment_contract_template_conf_id = Column(INTEGER(11), primary_key=True)
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    service_code = Column(String(200), nullable=False, server_default=text("''"), comment='业务Code')
    scene_contract_signature_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='电子签章配置id')
    contract_template_type_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='模板配置表类型id')
    contract_template_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='合同模板id')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人id')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id_bank = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class SceneCompanyApartmentRelation(Base):
    __tablename__ = 'scene_company_apartment_relation'

    scene_company_apartment_relation_id = Column(INTEGER(11), primary_key=True, comment='管理公司关联id')
    apartment_id = Column(INTEGER(11), server_default=text("'0'"), comment='门店id')
    scene_trusteeship_company_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='托管公司id')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='更新时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间')
    operator_employee_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='操作者id')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class SceneCompanyContact(Base):
    __tablename__ = 'scene_company_contacts'

    scene_company_contacts_id = Column(INTEGER(11), primary_key=True)
    scene_company_manage_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='项目公司管理id')
    contacts_name = Column(String(30), nullable=False, server_default=text("''"), comment='联系人姓名')
    contacts_phone = Column(String(11), nullable=False, server_default=text("''"), comment='联系人电话')
    contacts_email = Column(String(30), nullable=False, server_default=text("''"), comment='联系人邮箱')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人id')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class SceneCompanyManage(Base):
    __tablename__ = 'scene_company_manage'

    scene_company_manage_id = Column(INTEGER(11), primary_key=True)
    company_name = Column(String(128), nullable=False, server_default=text("''"), comment='公司名称')
    customer_phone = Column(String(11), nullable=False, server_default=text("''"), comment='公司电话')
    business_license_code = Column(String(66), nullable=False, server_default=text("''"), comment='营业执照号')
    organization_code = Column(String(66), nullable=False, server_default=text("''"), comment='组织机构代码')
    license_is_long = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='有无截止日期 1无')
    license_start_time = Column(String(20), nullable=False, server_default=text("''"), comment='营业执照有效起始时间')
    license_end_time = Column(String(20), nullable=False, server_default=text("''"), comment='营业执照有效截止时间')
    license_address = Column(String(255), nullable=False, server_default=text("''"), comment='营业执照地址')
    license_img = Column(String(66), nullable=False, server_default=text("''"), comment='营业执照副本图片')
    organization_img = Column(String(66), nullable=False, server_default=text("''"), comment='组织机构代码证图片')
    legal_person = Column(String(30), nullable=False, server_default=text("''"), comment='法人姓名')
    legal_person_card = Column(String(25), nullable=False, server_default=text("''"), comment='法人身份证号')
    legal_person_phone = Column(String(11), nullable=False, server_default=text("''"), comment='法人手机号')
    legal_person_email = Column(String(30), nullable=False, server_default=text("''"), comment='法人邮箱')
    legal_person_img = Column(String(66), nullable=False, server_default=text("''"), comment='法人身份证照片')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人id')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class SceneCompanyRelation(Base):
    __tablename__ = 'scene_company_relation'

    scene_company_relation_id = Column(INTEGER(11), primary_key=True)
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店id')
    scene_company_manage_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='项目管理id')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人id')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class SceneContractSignature(Base):
    __tablename__ = 'scene_contract_signature'

    scene_contract_signature_id = Column(INTEGER(11), primary_key=True)
    signature_type = Column(TINYINT(1), nullable=False, server_default=text("'2'"), comment='1个人  2公司')
    company_name = Column(String(200), nullable=False, server_default=text("''"), comment='公司名称')
    customer_id = Column(String(200), nullable=False, server_default=text("''"), comment='客户签名唯一识别id')
    phone = Column(String(11), nullable=False, server_default=text("''"), comment='手机号码')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人id')
    document_type = Column(String(62), nullable=False, server_default=text("''"), comment='证件类型')
    document_number = Column(String(62), nullable=False, server_default=text("''"), comment='证件号')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class SceneContractTemplate(Base):
    __tablename__ = 'scene_contract_template'

    contract_template_id = Column(INTEGER(11), primary_key=True)
    contract_template_type_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='模板类型ID')
    version_name = Column(String(200), nullable=False, server_default=text("''"), comment='版本名称(显示字段)')
    version_id = Column(String(200), nullable=False, server_default=text("''"), comment='版本名(唯一版本确定字段)')
    is_use = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否启用')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人id')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id_back = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class SceneContractTemplateType(Base):
    __tablename__ = 'scene_contract_template_type'

    contract_template_type_id = Column(INTEGER(11), primary_key=True)
    template_type_name = Column(String(200), nullable=False, server_default=text("''"), comment='合同模板类别')
    service_code = Column(String(200), nullable=False, server_default=text("''"), comment='业务Code')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id_back = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class SceneTrusteeshipCompany(Base):
    __tablename__ = 'scene_trusteeship_company'

    scene_trusteeship_company_id = Column(INTEGER(11), primary_key=True, comment='托管公司id')
    name = Column(String(128), nullable=False, server_default=text("''"), comment='托管公司名称')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='更新时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间')
    operator_employee_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='操作者id')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class ServiceFeeSubsidy(Base):
    __tablename__ = 'service_fee_subsidy'

    service_fee_subsidy_id = Column(INTEGER(11), primary_key=True, comment='合同分期补贴')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    contract_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='合同ID')
    is_subsidy = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否分期')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class ShortrentCard(Base):
    __tablename__ = 'shortrent_card'

    shortrent_card_id = Column(INTEGER(11), primary_key=True, comment='短租卡id')
    shortrent_card_type_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='卡类型id')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店id')
    begin_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='开始时间')
    end_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='结束时间')
    remarks = Column(String(256), nullable=False, server_default=text("''"), comment='备注')
    create_person = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建人')
    use_person = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='使用人')
    use_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='使用时间')
    is_use = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='0未使用,1已经使用,2已经作废')
    is_obsolete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否作废')
    document_number = Column(String(64), nullable=False, server_default=text("''"), comment='账单编号')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    table_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='使用短租卡的表id')
    table_name = Column(String(256), nullable=False, server_default=text("''"), comment='短租卡使用表')


class ShortrentCardType(Base):
    __tablename__ = 'shortrent_card_type'

    shortrent_card_type_id = Column(INTEGER(11), primary_key=True, comment='卡类型ID')
    card_name = Column(String(64), nullable=False, server_default=text("''"), comment='卡类型名称')
    card_prefixion = Column(String(16), nullable=False, server_default=text("''"), comment='卡类型前缀')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='更新时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')


class ShortrentCardTypeMonth(Base):
    __tablename__ = 'shortrent_card_type_month'

    shortrent_card_type_month_id = Column(INTEGER(11), primary_key=True, comment='卡类型月份表')
    shortrent_card_type_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='卡类型id')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='更新时间')
    term = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='周期')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')


class SmsCaptcha(Base):
    __tablename__ = 'sms_captcha'

    id = Column(INTEGER(11), primary_key=True)
    identifier = Column(String(20), nullable=False, server_default=text("'0'"), comment='唯一号')
    phone = Column(String(20), nullable=False, server_default=text("''"), comment='手机号')
    ipaddress = Column(String(20), nullable=False, server_default=text("''"), comment='用户IP')
    code = Column(String(10), server_default=text("''"), comment='内容')
    ext_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='过期时间')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='发送时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')


class SmsLogViewLog(Base):
    __tablename__ = 'sms_log_view_log'

    sms_log_view_Log_id = Column(INTEGER(11), primary_key=True)
    employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='查看记录的员工id')
    table_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='产生记录的表id')
    table_name = Column(String(64), nullable=False, server_default=text("''"), comment='产生记录的表名称')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class SmsNotice(Base):
    __tablename__ = 'sms_notice'

    id = Column(INTEGER(11), primary_key=True)
    phone = Column(String(20), nullable=False, server_default=text("''"), comment='手机号')
    ipaddress = Column(String(20), nullable=False, server_default=text("''"), comment='用户IP')
    apartment_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='门店id')
    content = Column(Text, comment='内容')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='发送时间')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')


class SpayMemberCompany(Base):
    __tablename__ = 'spay_member_company'

    spay_member_company_id = Column(INTEGER(11), primary_key=True)
    real_name = Column(String(32), nullable=False, server_default=text("''"), comment='真实姓名')
    identity_type = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='证件类型')
    identity_no = Column(LargeBinary, nullable=False, comment='证件号')
    key = Column(String(128), nullable=False, server_default=text("''"), comment='key')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class SpayMemberPersonal(Base):
    __tablename__ = 'spay_member_personal'

    spay_member_personal_id = Column(INTEGER(11), primary_key=True)
    real_name = Column(String(32), nullable=False, server_default=text("''"), comment='真实姓名')
    identity_type = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='证件类型')
    identity_no = Column(LargeBinary, nullable=False, comment='证件号')
    key = Column(String(128), nullable=False, server_default=text("''"), comment='key')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class SubjectsCardRelation(Base):
    __tablename__ = 'subjects_card_relation'

    id = Column(BIGINT(11), primary_key=True, comment='ID主键')
    subject_card_relation_id = Column(String(32), nullable=False, index=True, server_default=text("''"), comment='科目与银行卡主键ID')
    contract_bill_id = Column(String(32), nullable=False, index=True, server_default=text("''"), comment='合同账单主键ID')
    card_no = Column(String(32), nullable=False, server_default=text("''"), comment='银行卡号')
    subject_info_id = Column(String(64), nullable=False, server_default=text("''"), comment='科目ID')
    amount = Column(DECIMAL(10, 2), nullable=False, comment='科目金额')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否删除; 1:否, 2:是')
    operator_id = Column(String(32), nullable=False, server_default=text("'0'"), comment='操作人')
    organization_id = Column(String(32), nullable=False, server_default=text("'0'"), comment='组织ID')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class SubletApartmentConfigRelationship(Base):
    __tablename__ = 'sublet_apartment_config_relationship'

    id = Column(INTEGER(11), primary_key=True)
    sublet_config_relationship_id = Column(String(32), nullable=False, server_default=text("''"), comment='转租配置关联表')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    sublet_config_id = Column(String(32), nullable=False, server_default=text("''"), comment='方案配置ID')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作ID')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class SubletConfig(Base):
    __tablename__ = 'sublet_config'

    id = Column(INTEGER(11), primary_key=True)
    sublet_config_id = Column(String(32), nullable=False, server_default=text("''"), comment='转租配置ID')
    sublet_polymerization_id = Column(String(32), nullable=False, server_default=text("''"), comment='转租配置聚合ID')
    sublet_config_type = Column(TINYINT(2), nullable=False, server_default=text("'0'"), comment='1:委托转租2:租客自传')
    sublet_name = Column(String(64), nullable=False, server_default=text("''"), comment='方案名称')
    first_day = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='提前开始天数')
    last_day = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='提前结束天数')
    sublet_charging_type = Column(TINYINT(2), nullable=False, server_default=text("'0'"), comment='委托转租计费方式1：固定金额2:按租金比例')
    sublet_charging_num = Column(DECIMAL(11, 4), nullable=False, server_default=text("'0.0000'"), comment='委托转租计费方式数值')
    cancel_charging_type = Column(INTEGER(2), nullable=False, server_default=text("'0'"), comment='取消委托转租计费方式1：固定金额2:按租金比例')
    cancel_charging_num = Column(DECIMAL(11, 4), nullable=False, server_default=text("'0.0000'"), comment='取消委托转租计费方式数值')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人ID')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    is_delete = Column(TINYINT(11), nullable=False, server_default=text("'0'"), comment='0正常1删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class Surrender(Base):
    __tablename__ = 'surrender'

    surrender_id = Column(INTEGER(11), primary_key=True)
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    bill_id = Column(String(64), nullable=False, index=True, server_default=text("'0'"), comment='账单ID')
    surrender_time = Column(INTEGER(11), nullable=False, comment='退租日期')
    liquidated_damages = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='违约金')
    contract_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='合同ID')
    deposit = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='应退押金')
    rental = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='应退租金')
    discount = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='租金折扣比例')
    rental_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='租金收支类型(0:收入;1:支出)')
    is_reparation = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否赔偿')
    reparation_configuration_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='赔偿类型ID')
    reparation_money = Column(DECIMAL(10, 2), server_default=text("'0.00'"), comment='赔偿金额')
    remarks = Column(Text, comment='备注')
    surrender_type_configuration_id = Column(INTEGER(10), nullable=False, index=True, server_default=text("'0'"), comment='退租类型ID')
    sublet_apartment_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='转租门店')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, index=True, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    delivery_id = Column(String(32), nullable=False, server_default=text("''"), comment='物业交割单ID')


class SurrenderReasonConfiguration(Base):
    __tablename__ = 'surrender_reason_configuration'

    surrender_reason_id = Column(INTEGER(11), primary_key=True)
    description = Column(String(255), nullable=False, server_default=text("''"), comment='退租说明')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


t_surrender_reason_configuration_relationship = Table(
    'surrender_reason_configuration_relationship', metadata,
    Column('surrender_id', INTEGER(11), nullable=False, server_default=text("'0'"), comment='退租ID'),
    Column('company_id', INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID'),
    Column('surrender_reason_id', INTEGER(11), nullable=False, server_default=text("'0'"), comment='退租关系ID'),
    Column('operator_employee_id', INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人'),
    Column('create_time', INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间'),
    Column('update_time', INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间'),
    Column('is_delete', TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除'),
    Column('delete_time', INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
)


class SurrenderTypeConfiguration(Base):
    __tablename__ = 'surrender_type_configuration'

    surrender_type_configuration_id = Column(INTEGER(11), primary_key=True)
    name = Column(String(65), nullable=False, server_default=text("' '"), comment='类型名称')
    operator_employee_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='更新时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间')


class SurveyQuestionRecord(Base):
    __tablename__ = 'survey_question_record'

    question_record_id = Column(INTEGER(11), primary_key=True, comment='问卷调查记录id')
    tenant_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='租客id')
    apartment_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='门店id')
    phone = Column(String(11), nullable=False, server_default=text("''"), comment='租客手机号码')
    investigation_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='问卷调查id')
    question_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='问卷调查问题id')
    question_name = Column(String(100), nullable=False, server_default=text("''"), comment='问卷调查问题名称')
    star = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='得分')
    remarks = Column(String(255), server_default=text("' '"), comment='逗号分隔的意见')
    group_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='分组id')
    times = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='耗时')
    comments = Column(Text, nullable=False, comment='问卷调查备注')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class SurveyQuestionRecordV3(Base):
    __tablename__ = 'survey_question_record_v3'

    question_record_v3_id = Column(INTEGER(11), primary_key=True, comment='问卷调查记录id')
    tenant_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='租客id')
    apartment_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='门店id')
    phone = Column(String(11), nullable=False, server_default=text("''"), comment='租客手机号码')
    question_name = Column(String(100), nullable=False, server_default=text("''"), comment='问卷调查问题名称')
    option = Column(String(255), nullable=False, server_default=text("''"), comment='选项')
    remarks = Column(String(255), server_default=text("' '"), comment='更好的意见或者建议')
    group_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='分组id')
    times = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='耗时')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class SwitchRoomApartmentConfigRelationship(Base):
    __tablename__ = 'switch_room_apartment_config_relationship'

    id = Column(INTEGER(11), primary_key=True)
    switch_room_config_relationship_id = Column(String(32), nullable=False, server_default=text("''"), comment='换房服务配置关联表')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    apartment_name = Column(String(32), nullable=False, server_default=text("''"))
    switch_room_config_id = Column(String(32), nullable=False, server_default=text("''"), comment='方案配置ID')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作ID')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class SwitchRoomConfig(Base):
    __tablename__ = 'switch_room_config'

    id = Column(INTEGER(11), primary_key=True)
    switch_room_config_id = Column(String(32), nullable=False, server_default=text("''"), comment='换房服务费配置ID')
    switch_room_name = Column(String(64), nullable=False, server_default=text("''"), comment='方案名称')
    switch_room_charging_num = Column(DECIMAL(11, 4), nullable=False, server_default=text("'0.0000'"), comment='换房服务费计费方式数值')
    cancel_charging_num = Column(DECIMAL(11, 4), nullable=False, server_default=text("'0.0000'"), comment='换房服务费违约金计费方式数值')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人ID')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    is_delete = Column(TINYINT(11), nullable=False, server_default=text("'0'"), comment='0正常1删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class SystemCdk(Base):
    __tablename__ = 'system_cdk'

    system_cdk_id = Column(INTEGER(11), primary_key=True, comment='系统密钥ID')
    cdk = Column(VARCHAR(64), nullable=False, unique=True, server_default=text("''"), comment='密钥')
    is_use = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否使用')
    company_id = Column(INTEGER(10), server_default=text("'1'"), comment='公司ID')
    disable_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='停用状态; 1: 未分配; 2: 未使用; 3: 已停用; 4: 使用中')
    operator_employee_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='操作人ID')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='更新时间')
    is_delete = Column(TINYINT(11), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间')


class SystemCdkeyExtension(Base):
    __tablename__ = 'system_cdkey_extension'

    system_cdkey_extension_id = Column(INTEGER(11), primary_key=True)
    system_cdk_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='系统cdkeyID')
    employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='员工ID')
    equipment_type = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='设备类型; 1: 公司设备; 2: 个人设备')
    remarks = Column(Text, comment='备注')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除; 0: 未删除; 1: 删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class SystemConfiguration(Base):
    __tablename__ = 'system_configuration'

    sys_configuration_id = Column(INTEGER(11), primary_key=True, comment='系统配置id')
    table_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='来源表id')
    table_name = Column(String(10), nullable=False, server_default=text("''"), comment='来源表名称')
    value = Column(String(255), nullable=False, server_default=text("''"), comment='配置值')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作id')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='根系时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class SystemLog(Base):
    __tablename__ = 'system_log'

    system_log_id = Column(INTEGER(11), primary_key=True)
    tenant_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='租客id')
    contract_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='合同id')
    room_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='房间id')
    system_log_type_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='日志类型id')
    log_type_content = Column(Text, comment='日志的内容')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class SystemLogType(Base):
    __tablename__ = 'system_log_type'

    system_log_type_id = Column(INTEGER(11), primary_key=True)
    system_log_type_name = Column(String(32), nullable=False, server_default=text("''"), comment='系统日志类型名称')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class SystemServiceInfo(Base):
    __tablename__ = 'system_service_info'

    system_service_id = Column(String(64), primary_key=True, comment='主键')
    service_type = Column(String(32), nullable=False, comment='服务类型')
    service_status = Column(String(2), nullable=False, comment='状态 （0 -异常  1 -恢复）')
    service_grade = Column(INTEGER(16), nullable=False, comment='等级')
    service_max_value = Column(INTEGER(32), nullable=False, comment='峰值')
    create_time = Column(TIMESTAMP, nullable=False, server_default=text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"), comment='创建时间')


class TempNationalDaySubmit(Base):
    __tablename__ = 'temp_national_day_submit'

    temp_national_day_submit_id = Column(INTEGER(11), primary_key=True)
    name = Column(String(50), nullable=False, server_default=text("''"), comment='姓名')
    phone = Column(String(11), nullable=False, server_default=text("''"), comment='电话号码')
    city_id = Column(String(100), nullable=False, server_default=text("'0'"), comment='城市id')
    city_name = Column(String(100), nullable=False, server_default=text("'0'"), comment='城市名称')
    city_area_cus = Column(String(100), nullable=False, server_default=text("'0'"), comment='区域')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间')


class TemplateHead(Base):
    __tablename__ = 'template_head'
    __table_args__ = (
        Index('table_id_name', 'table_id', 'table_name'),
    )

    head_id = Column(INTEGER(11), primary_key=True)
    table_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='来源表id')
    table_name = Column(String(64), nullable=False, server_default=text("''"), comment='来源表名')
    true_table_name = Column(String(64), nullable=False, server_default=text("''"), comment='来源表名')
    head_field = Column(String(255), nullable=False, server_default=text("''"), comment='表头')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class TenancyOrder(Base):
    __tablename__ = 'tenancy_order'

    tenancy_order_id = Column(String(32), primary_key=True, server_default=text("''"), comment='主键id')
    contract_id = Column(INTEGER(10), nullable=False, index=True, server_default=text("'0'"), comment='合同id')
    revoke_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='退租时间')
    transaction_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='退租交易日期')
    revoke_reason = Column(String(100), nullable=False, server_default=text("''"), comment='退租原因：租期到期,更换房间,房间太贵,工作地点变化,装修不满意,异味（甲醛等）,其他')
    revoke_type = Column(INTEGER(1), nullable=False, server_default=text("'0'"), comment='退房类型：正常退租,违约退租,委托转租,租客自转,转店')
    is_indemnity = Column(INTEGER(1), nullable=False, server_default=text("'0'"), comment='是否赔偿：1：是，2：否')
    indemnity_reason = Column(String(100), server_default=text("''"), comment='赔偿原因')
    image_url = Column(String(1000), server_default=text("''"), comment='图片附件地址')
    remark = Column(String(1024), server_default=text("''"), comment='备注信息')
    ap_delivery_id = Column(String(32), nullable=False, server_default=text("''"), comment='物业交割单id')
    operation_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='操作人id')
    operation_type = Column(INTEGER(1), nullable=False, server_default=text("'0'"), comment='操作人类型：1租客，2管家')
    revoke_status = Column(INTEGER(1), nullable=False, server_default=text("'0'"), comment='退租状态：1待退租，2待确认，3已完成, 4已取消')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_status = Column(TINYINT(1), nullable=False, index=True, server_default=text("'1'"), comment='是否删除')
    delete_time = Column(INTEGER(10), server_default=text("'0'"), comment='删除时间')
    apply_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='申请人id')
    room_id = Column(INTEGER(10), comment='房间id')
    bank_card_id = Column(String(32), index=True)
    tenant_bill_id = Column(String(200), server_default=text("''"), comment='退给租客账单的bill_id')
    bill_id = Column(String(200), server_default=text("''"), comment='退给月付方账单的bill_id')
    normal_bill_id = Column(String(200), server_default=text("''"), comment='普通应退bill_id')
    cleared = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否清退，1 是， 0 否')


class TenancyOrderSubject(Base):
    __tablename__ = 'tenancy_order_subject'

    tenancy_order_subject_id = Column(String(32), primary_key=True, server_default=text("''"), comment='主键id')
    tenancy_order_id = Column(String(32), nullable=False, server_default=text("''"), comment='退租单id')
    subject_info_id = Column(String(32), nullable=False, server_default=text("''"), comment='租务科目id')
    cost_amount = Column(DECIMAL(12, 2), nullable=False, server_default=text("'0.00'"), comment='科目金额')
    cost_name = Column(String(50), nullable=False, server_default=text("''"), comment='科目名称')
    operator_id = Column(INTEGER(10), server_default=text("'0'"), comment='操作人id')
    cost_type = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='退扣款 1扣 2 退   1正 2负')
    subject_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='退款方类型 0=退款科目类型  1=退给租客  2= 退给月付方')
    organization_id = Column(INTEGER(10), server_default=text("'0'"), comment='组织id')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(10), server_default=text("'0'"), comment='删除时间')


class TenancyRequestErrorLog(Base):
    __tablename__ = 'tenancy_request_error_log'

    tenancy_request_error_log_id = Column(String(32), primary_key=True, server_default=text("''"), comment='主键ID')
    local_interface_name = Column(String(50), nullable=False, server_default=text("''"), comment='本地接口名称')
    local_interface_path = Column(String(100), nullable=False, server_default=text("''"), comment='本地接口路径')
    opposite_interface_name = Column(String(50), nullable=False, server_default=text("''"), comment='对方接口名称')
    opposite_interface_path = Column(String(100), nullable=False, comment='对方接口路径')
    local_qualified_name = Column(String(50), nullable=False, comment='本地方法完全限定名')
    error_log = Column(String(500), nullable=False, server_default=text("''"), comment='错误内容')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='1正常，2已删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))


class Tenant(Base):
    __tablename__ = 'tenant'

    tenant_id = Column(INTEGER(11), primary_key=True)
    phone_md5 = Column(String(32), nullable=False, index=True, server_default=text("''"), comment='手机号MD5')
    phone = Column(LargeBinary, nullable=False, comment='手机号码')
    emergency_phone_md5 = Column(String(32), nullable=False, server_default=text("''"), comment='紧急联系人电话MD5')
    emergency_phone = Column(LargeBinary, comment='紧急联系人电话')
    name = Column(String(25), nullable=False, server_default=text("''"), comment='租客姓名')
    address = Column(String(128), nullable=False, server_default=text("''"), comment='住址')
    mailing_address = Column(String(128), nullable=False, server_default=text("''"), comment='通讯地址')
    emergency_contact = Column(String(32), nullable=False, server_default=text("''"), comment='紧急联系人')
    idcard_md5 = Column(String(32), nullable=False, server_default=text("''"), comment='证件号MD5')
    idcard = Column(LargeBinary, comment='证件号')
    idcard_type = Column(String(5), nullable=False, server_default=text("''"), comment='证件号类型0-身份证；1-护照；B-港澳通行证；C-入台证')
    interpersonal_relation_configuration_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='紧急联系人关系id')
    gender = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='性别（1男,2女）')
    password = Column(String(32), nullable=False, server_default=text("'0'"), comment='密码')
    weixin_openid = Column(String(255), nullable=False, server_default=text("''"), comment='微信openid')
    is_virtual = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否是虚拟1是0否')
    is_real_name_auth = Column(INTEGER(11), server_default=text("'0'"), comment='是否已实名认证')
    remarks = Column(String(255), nullable=False, server_default=text("' '"), comment='租客备注')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class Tenant20180529Yubo(Base):
    __tablename__ = 'tenant_2018_05_29_yubo'

    tenant_id = Column(INTEGER(11), primary_key=True)
    phone_md5 = Column(String(32), nullable=False, server_default=text("''"), comment='手机号MD5')
    phone = Column(LargeBinary, nullable=False, comment='手机号码')
    emergency_phone_md5 = Column(String(32), nullable=False, server_default=text("''"), comment='紧急联系人电话MD5')
    emergency_phone = Column(LargeBinary, nullable=False, comment='紧急联系人电话')
    name = Column(String(20), nullable=False, server_default=text("''"), comment='租客姓名')
    emergency_contact = Column(String(32), nullable=False, server_default=text("' '"), comment='紧急联系人')
    idcard_md5 = Column(String(32), nullable=False, server_default=text("''"), comment='证件号MD5')
    idcard = Column(LargeBinary, nullable=False, comment='证件号')
    idcard_type = Column(String(5), nullable=False, server_default=text("''"), comment='证件号类型')
    interpersonal_relation_configuration_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='紧急联系人关系id')
    gender = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='性别（1男,2女）')
    password = Column(String(32), nullable=False, server_default=text("'0'"), comment='密码')
    weixin_openid = Column(String(255), nullable=False, comment='微信openid')
    is_virtual = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否是虚拟1是0否')
    is_real_name_auth = Column(INTEGER(11), server_default=text("'0'"), comment='是否已实名认证')
    remarks = Column(String(255), nullable=False, server_default=text("' '"), comment='租客备注')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class TenantContractException(Base):
    __tablename__ = 'tenant_contract_exception'

    id = Column(INTEGER(11), primary_key=True, comment='主键ID')
    tenant_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='租客ID')
    room_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='房间id')
    contract_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='合同ID')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    content = Column(Text, comment='返回日志信息')
    tenant_contract_exception_id = Column(String(64), nullable=False, server_default=text("''"), comment='uuid')


class TenantContractRelationship(Base):
    __tablename__ = 'tenant_contract_relationship'

    tenant_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='租客ID')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    contract_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='合同ID')
    is_ious = Column(TINYINT(3), nullable=False, server_default=text("'0'"), comment='是否分期')
    is_contractor = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否是签约人 1= 签约人')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    effective_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='1有效，2未生效，3失效')
    id = Column(INTEGER(11), primary_key=True, comment='主键ID')
    status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='签约状态:1正常 0签约异常')
    content = Column(Text, comment='返回日志信息')


class TenantCopy1(Base):
    __tablename__ = 'tenant_copy1'

    tenant_id = Column(INTEGER(11), primary_key=True)
    phone_md5 = Column(String(32), nullable=False, index=True, server_default=text("''"), comment='手机号MD5')
    phone = Column(LargeBinary, nullable=False, comment='手机号码')
    emergency_phone_md5 = Column(String(32), nullable=False, server_default=text("''"), comment='紧急联系人电话MD5')
    emergency_phone = Column(LargeBinary, nullable=False, comment='紧急联系人电话')
    name = Column(String(25), nullable=False, server_default=text("''"), comment='租客姓名')
    address = Column(String(128), server_default=text("''"), comment='住址')
    mailing_address = Column(String(128), server_default=text("''"), comment='通讯地址')
    emergency_contact = Column(String(32), nullable=False, server_default=text("''"), comment='紧急联系人')
    idcard_md5 = Column(String(32), nullable=False, server_default=text("''"), comment='证件号MD5')
    idcard = Column(LargeBinary, nullable=False, comment='证件号')
    idcard_type = Column(String(5), nullable=False, server_default=text("''"), comment='证件号类型0-身份证；1-护照；B-港澳通行证；C-入台证')
    interpersonal_relation_configuration_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='紧急联系人关系id')
    gender = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='性别（1男,2女）')
    password = Column(String(32), nullable=False, server_default=text("'0'"), comment='密码')
    weixin_openid = Column(String(255), nullable=False, server_default=text("''"), comment='微信openid')
    is_virtual = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否是虚拟1是0否')
    is_real_name_auth = Column(INTEGER(11), server_default=text("'0'"), comment='是否已实名认证')
    remarks = Column(String(255), nullable=False, server_default=text("' '"), comment='租客备注')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class TenantExtendInfo(Base):
    __tablename__ = 'tenant_extend_info'

    extend_info_id = Column(INTEGER(11), primary_key=True)
    tenant_id = Column(INTEGER(11), nullable=False, index=True, comment='租客ID')
    company_name = Column(VARCHAR(50), nullable=False, server_default=text("''"), comment='工作单位')
    company_address = Column(VARCHAR(255), nullable=False, server_default=text("''"), comment='单位地址')
    company_contact = Column(VARCHAR(30), nullable=False, server_default=text("''"), comment='单位联系人')
    company_contract_phone_md5 = Column(String(32), nullable=False, server_default=text("''"), comment='单位联系人电话MD5')
    company_contract_phone = Column(LargeBinary, nullable=False, comment='单位联系人电话')
    emergency_contact = Column(VARCHAR(30), nullable=False, server_default=text("''"), comment='紧急联系人')
    emergency_phone_md5 = Column(String(32), nullable=False, server_default=text("''"), comment='紧急联系人电话MD5')
    emergency_phone = Column(LargeBinary, nullable=False, comment='紧急联系人电话')
    interpersonal_relation_configuration_id = Column(INTEGER(1), nullable=False, comment='紧急联系人关系ID')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class TenantFinanceSequence(Base):
    __tablename__ = 'tenant_finance_sequence'

    tenant_finance_sequence_id = Column(INTEGER(11), primary_key=True)
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    tenant_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='租客ID')
    bill_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='账单表ID')
    table_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作表ID')
    table_name = Column(String(100), nullable=False, server_default=text("''"), comment='操作表名(不一定等于bill表中的table_name)')
    money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='金额')
    type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='收支(0:收入;1:支持)')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class TenantImgResource(Base):
    __tablename__ = 'tenant_img_resource'

    tenant_img_resource_id = Column(INTEGER(11), primary_key=True, comment='租客图片资源ID')
    tenant_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='租客ID')
    img_name = Column(String(255), nullable=False, server_default=text("' '"), comment='图片名称')
    img_type = Column(TINYINT(2), nullable=False, server_default=text("'0'"), comment='图片类型1身份证正面2身份证方面')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='更新时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class TenantYearBill(Base):
    __tablename__ = 'tenant_year_bill'

    tenant_year_bill_id = Column(String(32), primary_key=True, comment='租户年度账单ID')
    tenant_id = Column(INTEGER(11), server_default=text("'0'"), comment='租户ID')
    openId = Column(String(256), server_default=text("' '"), comment='微信唯一标示')
    tenant_phone = Column(String(32), nullable=False, comment='租户签约手机号')
    sex = Column(TINYINT(1))
    birthday = Column(String(32), nullable=False, comment='租户生日')
    tenant_ranking = Column(INTEGER(11), server_default=text("'0'"), comment='入住排名')
    ranking_time = Column(INTEGER(11), server_default=text("'0'"), comment='入住时间')
    city_id = Column(INTEGER(11), server_default=text("'0'"), comment='城市ID')
    city_consume_ranking = Column(INTEGER(11), server_default=text("'0'"), comment='城市消费排名')
    city_name = Column(String(32), nullable=False, comment='城市名称')
    apartment_id = Column(INTEGER(11), server_default=text("'0'"), comment='门店id')
    apartment_name = Column(String(32), nullable=False, comment='门店名称')
    earliest_opendoor_time = Column(INTEGER(11), server_default=text("'0'"), comment='最早开门时间')
    Latest_opendoor_time = Column(INTEGER(11), server_default=text("'0'"), comment='最晚开门时间')
    live_number = Column(INTEGER(11), server_default=text("'0'"), comment='居住天数')
    consume_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='消费金额')
    consume_ranking = Column(INTEGER(11), server_default=text("'0'"), comment='消费排行')
    water_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='水费')
    crux_word = Column(String(255), server_default=text("' '"), comment='年度关键词')
    electricity_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='电费')
    cityAvgWaterMoney = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='城市平均水费')
    cityAvgelectricityMoney = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='城市平均电费')
    create_time = Column(INTEGER(11), server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), server_default=text("'0'"), comment='修改时间')
    delete_status = Column(TINYINT(4), server_default=text("'0'"), comment='删除状态(1:未删除,2:已删除)')
    delete_time = Column(INTEGER(11), server_default=text("'0'"), comment='删除时间')


class Test(Base):
    __tablename__ = 'test'

    id = Column(INTEGER(11), primary_key=True)
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    name = Column(String(50), nullable=False, server_default=text("''"), comment='test值')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class TestDailyDatum(Base):
    __tablename__ = 'test_daily_data'

    id = Column(BIGINT(20), primary_key=True)
    apartment_id = Column(BIGINT(20), nullable=False, server_default=text("'0'"), comment='门店ID')
    day_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='日报时间')
    rentRate = Column(Float(asdecimal=True), nullable=False, server_default=text("'0'"), comment='入住率')
    occupancyRate = Column(Float(asdecimal=True), nullable=False, server_default=text("'0'"), comment='招租率')
    interNightRate = Column(Float(asdecimal=True), nullable=False, server_default=text("'0'"), comment='间夜率')


class Toll(Base):
    __tablename__ = 'toll'

    toll_id = Column(INTEGER(11), primary_key=True)
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    room_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='房间ID')
    contract_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='合同ID')
    remarks = Column(Text, comment='备注')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class TpShanzu(Base):
    __tablename__ = 'tp_shanzu'

    id = Column(INTEGER(11), primary_key=True)
    lid = Column(INTEGER(11), nullable=False, unique=True, comment='线索id（闪猪定义唯一ID')
    hotel_no = Column(INTEGER(11), nullable=False, comment='公寓编号（闪猪系统内部定义）')
    lefull_hotel_no = Column(INTEGER(11), nullable=False, comment='公寓编号（乐乎系统内部定义）')
    name = Column(String(24), comment='客户姓名')
    sex = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='客户性别 男 1，女 0')
    phone_no = Column(String(24), comment='客户手机号')
    come_from = Column(INTEGER(5), comment='来源渠道')
    sale_name = Column(String(24), comment='上户销售人')
    sale_phone_no = Column(String(24), comment='上户销售手机号：外部上户人员手机号固定填0,区分是否乐乎员工')
    sale_remark = Column(String(255), comment='上户留言')
    receive_name = Column(String(24), comment='带户人')
    receive_phone_no = Column(String(24), comment='带户员工手机号')
    receive_date = Column(INTEGER(11), comment='看房接待时间')
    receive_remark = Column(String(255), comment='看房反馈内容')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), comment='删除时间')
    create_time = Column(INTEGER(11), comment='创建时间')
    status = Column(INTEGER(2), nullable=False, server_default=text("'0'"), comment='线索状态：0 插入 1 同步 2 失败')
    live_number = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='计划入住人数')
    live_date = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='计划入住时间')
    live_price = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='预期看房价格')
    cus_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"))
    dadad = Column(INTEGER(1), nullable=False, server_default=text("'0'"))


class TradingNumber(Base):
    __tablename__ = 'trading_number'

    trading_number_id = Column(INTEGER(11), primary_key=True)
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    company_region_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='区域公司ID')
    company_region_name = Column(String(32), nullable=False, comment='区域公司名称')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店id')
    apartment_name = Column(String(32), nullable=False, comment='门店名称')
    contract_count_number = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='直签成交量')
    preordain_count_number = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='预定成交量')
    apartment_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='门店类型 1-筹开门店 2 运营门店 3 单店门店 ')
    count_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='统计时间')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class UetoEmployee(Base):
    __tablename__ = 'ueto_employee'
    __table_args__ = (
        Index('table_name', 'table_name', 'table_id'),
    )

    ueto_employee_id = Column(String(32), primary_key=True)
    organization_id = Column(INTEGER(11), nullable=False, server_default=text("'1'"), comment='组织ID')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    table_name = Column(String(100), nullable=False, server_default=text("''"), comment='产生上户的表名称')
    table_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='产生上户的表ID')
    employee_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='员工ID')
    sale_group_leader_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='组长id')
    employee_group_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='员工组id')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    create_time = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    effective_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='1:有效,2:无效,3:失效')


class UponcommisionApartmentAccount(Base):
    __tablename__ = 'uponcommision_apartment_account'

    uponcommision_apartment_account_id = Column(VARCHAR(32), primary_key=True, comment='有朋提佣账户编号')
    apartment_id = Column(VARCHAR(32), nullable=False, comment='门店ID')
    organization_id = Column(VARCHAR(32), nullable=False, server_default=text("'0'"), comment='组织id')
    payment_account_id = Column(INTEGER(32), comment='付款账户ID')
    receivables_account_id = Column(INTEGER(32), comment='收款账户ID')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), server_default=text("'0'"), comment='修改时间')
    delete_status = Column(TINYINT(4), server_default=text("'0'"), comment='删除状态(1:未删除,2:已删除)')
    delete_time = Column(INTEGER(11), server_default=text("'0'"), comment='删除时间')
    apply_type = Column(INTEGER(11), server_default=text("'1'"), comment='适用类型(1:销售计提 2:流水计提 3:软件计提,4销售佣金（续约），5流水计提（退租退订），6软件费（退租退订）)')


class UponcommisionFinanceRuleConfig(Base):
    __tablename__ = 'uponcommision_finance_rule_config'
    __table_args__ = (
        Index('apartment_id', 'apartment_id', 'delete_status'),
    )

    uponcommision_finance_rule_config_id = Column(VARCHAR(32), primary_key=True, comment='有朋财务成本规则主键ID')
    apartment_id = Column(VARCHAR(32), nullable=False, comment='门店ID')
    valid_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='生效类型（1:永久2选定时间段）')
    commision_valid_begin_time = Column(INTEGER(11), server_default=text("'0'"), comment='规则有效开始时间')
    commision_valid_end_time = Column(INTEGER(11), server_default=text("'0'"), comment='规则有效结束时间')
    rule_group_id = Column(VARCHAR(32), nullable=False, comment='规则组ID')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), server_default=text("'0'"), comment='修改时间')
    delete_status = Column(TINYINT(4), server_default=text("'0'"), comment='删除状态(1:未删除,2:已删除)')
    delete_time = Column(INTEGER(11), server_default=text("'0'"), comment='删除时间')
    is_old_contract_partake = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='老合同是否参与:0参与1不参与）')


class UponcommisionFinanceRuleDetail(Base):
    __tablename__ = 'uponcommision_finance_rule_detail'

    uponcommision_finance_rule_detail_id = Column(VARCHAR(32), primary_key=True, comment='有朋财务成本规则详情ID')
    uponcommision_finance_rule_config_id = Column(VARCHAR(32), nullable=False, comment='有朋财务成本规则主键ID')
    finance_proportion = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='财务成本比例')
    rule_group_id = Column(VARCHAR(32), nullable=False, comment='规则组ID')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), server_default=text("'0'"), comment='修改时间')
    delete_status = Column(TINYINT(1), server_default=text("'0'"), comment='删除状态(1:未删除,2:已删除)')
    delete_time = Column(INTEGER(11), server_default=text("'0'"), comment='删除时间')


class UponcommisionPipeliningRule(Base):
    __tablename__ = 'uponcommision_pipelining_rule'

    uponcommision_pipelining_rule_id = Column(VARCHAR(32), primary_key=True, comment='主键ID')
    apartment_id = Column(INTEGER(11), server_default=text("'0'"), comment='门店id')
    import_status = Column(TINYINT(1), server_default=text("'0'"), comment='老合同是否参与：1否，2是')
    service_status = Column(TINYINT(1), comment='应收金额是否包含服务费(1 不含 2 包含)')
    all_status = Column(TINYINT(1), comment='是否通提(1 否 2是)')
    check_status = Column(TINYINT(1), comment='判断条件(1 无  2是)')
    pipelining_proportion = Column(DECIMAL(10, 2), server_default=text("'0.00'"), comment='流水计提比例')
    software_fee_proportion = Column(DECIMAL(10, 2), server_default=text("'0.00'"), comment='软件费比例')
    valid_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='生效类型（1:永久2选定时间段）')
    commision_valid_begin_time = Column(INTEGER(10), server_default=text("'0'"), comment='规则有效开始时间')
    commision_valid_end_time = Column(INTEGER(10), server_default=text("'0'"), comment='规则有效结束时间')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), server_default=text("'0'"), comment='修改时间')
    delete_status = Column(TINYINT(1), server_default=text("'0'"), comment='删除状态(1:未删除,2:已删除)')
    delete_time = Column(INTEGER(11), server_default=text("'0'"), comment='删除时间')


class UponcommisionPipeliningRuleCondition(Base):
    __tablename__ = 'uponcommision_pipelining_rule_condition'

    uponcommision_pipelining_rule_condition_id = Column(VARCHAR(32), primary_key=True, comment='主键ID')
    uponcommision_pipelining_rule_id = Column(String(32), comment='有朋提佣-流水计提规则主键ID')
    cal_type = Column(TINYINT(1), server_default=text("'0'"), comment='计算基数(1 流水计提 2 软件费/人才费)')
    index_type = Column(TINYINT(1), comment='指标(1 入住率 2 招租率 3 间夜出租率)')
    index_begin = Column(DECIMAL(10, 2), server_default=text("'0.00'"), comment='指标区间开始')
    index_end = Column(DECIMAL(10, 2), server_default=text("'0.00'"), comment='指标区间结束')
    cal_proportion = Column(DECIMAL(10, 2), server_default=text("'0.00'"), comment='计算比例')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), server_default=text("'0'"), comment='修改时间')
    delete_status = Column(TINYINT(1), server_default=text("'0'"), comment='删除状态(1:未删除,2:已删除)')
    delete_time = Column(INTEGER(11), server_default=text("'0'"), comment='删除时间')


class UponcommisionSaleCheckinRule(Base):
    __tablename__ = 'uponcommision_sale_checkin_rule'

    uponcommision_sale_checkin_rule_id = Column(VARCHAR(32), primary_key=True, comment='有朋销售提拥规则明细主键ID')
    apartment_id = Column(INTEGER(11), server_default=text("'0'"), comment='门店id')
    count_type = Column(TINYINT(1), server_default=text("'0'"), comment='计算类型(1:按比例收取,2:固定金额收取)')
    sale_proportion = Column(DECIMAL(10, 2), server_default=text("'0.00'"), comment='销售提成比例')
    same_amount = Column(DECIMAL(10, 2), server_default=text("'0.00'"), comment='固定金额收取')
    valid_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='生效类型（1:永久2选定时间段）')
    commision_valid_begin_time = Column(INTEGER(11), server_default=text("'0'"), comment='规则有效开始时间')
    commision_valid_end_time = Column(INTEGER(11), server_default=text("'0'"), comment='规则有效结束时间')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), server_default=text("'0'"), comment='修改时间')
    delete_status = Column(TINYINT(1), server_default=text("'0'"), comment='删除状态(1:未删除,2:已删除)')
    delete_time = Column(INTEGER(11), server_default=text("'0'"), comment='删除时间')


class UponcommisionSaleRenewRule(Base):
    __tablename__ = 'uponcommision_sale_renew_rule'

    uponcommision_sale_renew_rule_id = Column(VARCHAR(32), primary_key=True, comment='有朋续约销售提成规则明细主键ID')
    apartment_id = Column(INTEGER(11), server_default=text("'0'"), comment='门店id')
    count_type = Column(TINYINT(1), server_default=text("'0'"), comment='计算类型(1:按比例收取,2:固定金额收取)')
    sale_proportion = Column(DECIMAL(10, 2), server_default=text("'0.00'"), comment='销售提成比例')
    same_amount = Column(DECIMAL(10, 2), server_default=text("'0.00'"), comment='固定金额收取')
    valid_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='生效类型（1:永久2选定时间段）')
    commision_valid_begin_time = Column(INTEGER(11), server_default=text("'0'"), comment='规则有效开始时间')
    commision_valid_end_time = Column(INTEGER(11), server_default=text("'0'"), comment='规则有效结束时间')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), server_default=text("'0'"), comment='修改时间')
    delete_status = Column(TINYINT(1), server_default=text("'0'"), comment='删除状态(1:未删除,2:已删除)')
    delete_time = Column(INTEGER(11), server_default=text("'0'"), comment='删除时间')


class UponcommisionSettlement(Base):
    __tablename__ = 'uponcommision_settlement'

    uponcommision_settlement_id = Column(VARCHAR(32), primary_key=True, comment='主键ID')
    bill_term = Column(INTEGER(5), server_default=text("'0'"), comment='第几期账单')
    contract_id = Column(VARCHAR(32), server_default=text("''"), comment='合同id（预定id）')
    city_id = Column(INTEGER(11), server_default=text("'0'"), comment='城市id')
    apartment_id = Column(INTEGER(11), server_default=text("'0'"), comment='门店id')
    room_id = Column(INTEGER(11), server_default=text("'0'"), comment='房间id')
    tenant_id = Column(INTEGER(11), server_default=text("'0'"), comment='租客id')
    service_code = Column(VARCHAR(50), server_default=text("''"), comment='场景code')
    receivable_amount = Column(DECIMAL(24, 16), server_default=text("'0.0000000000000000'"), comment='应收金额')
    received_amount = Column(DECIMAL(24, 16), server_default=text("'0.0000000000000000'"), comment='实收金额')
    sale_commision_amount = Column(DECIMAL(24, 16), server_default=text("'0.0000000000000000'"), comment='销售佣金')
    sale_renew_commision_amount = Column(DECIMAL(24, 16), server_default=text("'0.0000000000000000'"), comment='销售佣金（续约）')
    flow_commision_amount = Column(DECIMAL(24, 16), server_default=text("'0.0000000000000000'"), comment='流水计提')
    flow_surrender_commision_amount = Column(DECIMAL(24, 16), server_default=text("'0.0000000000000000'"), comment='流水计提（退租退订）')
    software_commision_amount = Column(DECIMAL(24, 16), server_default=text("'0.0000000000000000'"), comment='软件费/人才费')
    software_surrender_commision_amount = Column(DECIMAL(24, 16), server_default=text("'0.0000000000000000'"), comment='软件费/人才费（退租退订）')
    finance_commision_amount = Column(DECIMAL(24, 16), server_default=text("'0.0000000000000000'"), comment='财务成本（不需要提现，只计算保存并展示）')
    total_commision_amount = Column(DECIMAL(24, 16), server_default=text("'0.0000000000000000'"), comment='总佣金')
    account_time = Column(INTEGER(10), server_default=text("'0'"), comment='记账时间：年月日的10位时间戳')
    settlement_status = Column(TINYINT(1), server_default=text("'0'"), comment='销售佣金结佣（提现）状态：0待提现（不可操作）,1待结佣，2结佣中，3部分结佣，4全部结佣（已结佣），5结佣失败，6到账异常（如金额不对等）')
    settlement_renew_status = Column(TINYINT(1), server_default=text("'0'"), comment='销售佣金（续约）结佣（提现）状态：0待提现（不可操作）,1待结佣，2结佣中，3部分结佣，4全部结佣（已结佣），5结佣失败，6到账异常（如金额不对等）')
    flow_status = Column(TINYINT(1), server_default=text("'0'"), comment='流水计提结佣（提现）状态：0待提现（不可操作）,1待结佣，2结佣中，3部分结佣，4全部结佣（已结佣），5结佣失败，6到账异常（如金额不对等）')
    flow_surrender_status = Column(TINYINT(1), server_default=text("'0'"), comment='流水计提（退租退订）结佣（提现）状态：0待提现（不可操作）,1待结佣，2结佣中，3部分结佣，4全部结佣（已结佣），5结佣失败，6到账异常（如金额不对等）')
    software_status = Column(TINYINT(1), server_default=text("'0'"), comment='软件费结佣（提现）状态：0待提现（不可操作）,1待结佣，2结佣中，3部分结佣，4全部结佣（已结佣），5结佣失败，6到账异常（如金额不对等）')
    software_surrender_status = Column(TINYINT(1), server_default=text("'0'"), comment='软件费（退租退订）结佣（提现）状态：0待提现（不可操作）,1待结佣，2结佣中，3部分结佣，4全部结佣（已结佣），5结佣失败，6到账异常（如金额不对等）')
    transfer_remark = Column(VARCHAR(100), server_default=text("''"), comment='转账失败或异常的记录')
    subject_name = Column(VARCHAR(100), server_default=text("'-'"), comment='科目包 ：租金...(+n)')
    create_time = Column(INTEGER(10), server_default=text("'0'"))
    update_time = Column(INTEGER(10), server_default=text("'0'"))
    delete_status = Column(TINYINT(10), server_default=text("'1'"), comment='1正常，2删除')
    delete_time = Column(INTEGER(10), server_default=text("'0'"))
    employee_id = Column(INTEGER(11), server_default=text("'0'"), comment='操作人')


class UponcommisionSettlementItem(Base):
    __tablename__ = 'uponcommision_settlement_item'

    uponcommision_settlement_item_id = Column(VARCHAR(32), primary_key=True, comment='主键ID')
    uponcommision_settlement_id = Column(VARCHAR(32), server_default=text("''"), comment='有朋提佣-结佣主表ID')
    subject_info_id = Column(VARCHAR(32), server_default=text("''"), comment='科目id')
    subject_name = Column(VARCHAR(20), server_default=text("''"), comment='科目名称及拼接（如：租金 * 3（收入））')
    subject_number = Column(INTEGER(11), server_default=text("'1'"), comment='此科目有多少笔')
    amount_type = Column(TINYINT(1), server_default=text("'0'"), comment='财务类型：1收入，2支出')
    receivable_amount = Column(DECIMAL(24, 16), server_default=text("'0.0000000000000000'"), comment='应收总额金额（如果同一科目有三笔，则存三笔的总额）')
    create_time = Column(INTEGER(10), server_default=text("'0'"))
    update_time = Column(INTEGER(10), server_default=text("'0'"))
    delete_time = Column(INTEGER(10), server_default=text("'0'"))
    delete_status = Column(TINYINT(1), server_default=text("'1'"), comment='1正常，2删除')
    employee_id = Column(INTEGER(11), server_default=text("'0'"), comment='操作人id')


t_uponcommision_settlement_transfer = Table(
    'uponcommision_settlement_transfer', metadata,
    Column('uponcommision_settlement_id', VARCHAR(32), nullable=False, server_default=text("''"), comment='有朋结佣主表ID'),
    Column('uponcommision_transfer_record_id', VARCHAR(32), nullable=False, server_default=text("''"), comment='有朋结佣转账记录ID'),
    Column('create_time', INTEGER(10), nullable=False, server_default=text("'0'")),
    Column('update_time', INTEGER(10), server_default=text("'0'")),
    Column('delete_time', INTEGER(10), server_default=text("'0'")),
    Column('delete_status', TINYINT(1), server_default=text("'1'"), comment='1正常，2删除'),
    Column('employee_id', VARCHAR(32), server_default=text("''"), comment='操作人id')
)


class UponcommisionSubject(Base):
    __tablename__ = 'uponcommision_subject'

    uponcommision_subject_id = Column(VARCHAR(32), primary_key=True, comment='主键id')
    apartment_id = Column(VARCHAR(32), server_default=text("''"), comment='门店id')
    apartment_name = Column(VARCHAR(255), server_default=text("''"), comment='门店名称')
    subject_code = Column(VARCHAR(255), server_default=text("''"), comment='科目code')
    subject_name = Column(VARCHAR(255), server_default=text("''"), comment='科目名称')
    subject_type = Column(TINYINT(2), server_default=text("'1'"), comment='科目类型：1系统内科目，2自定义科目')
    create_time = Column(INTEGER(10), server_default=text("'0'"))
    update_time = Column(INTEGER(10), server_default=text("'0'"))
    delete_time = Column(INTEGER(10), server_default=text("'0'"))
    delete_status = Column(TINYINT(2), server_default=text("'1'"), comment='删除状态：1正常，2删除')
    employee_id = Column(VARCHAR(32), server_default=text("''"))
    city_id = Column(VARCHAR(32), server_default=text("''"))
    city_name = Column(VARCHAR(255), server_default=text("''"))
    selling_commission = Column(TINYINT(2), server_default=text("'1'"), comment='销售佣金(1:是 2:否)')
    accrued_amount = Column(TINYINT(2), server_default=text("'1'"), comment='流水计提(1:是 2:否)')
    software_billing = Column(TINYINT(2), server_default=text("'1'"), comment='软件计提(1:是 2:否)')


class UponcommisionSurrenderPipeliningRule(Base):
    __tablename__ = 'uponcommision_surrender_pipelining_rule'

    uponcommision_surrender_pipelining_rule_id = Column(VARCHAR(32), primary_key=True, comment='主键ID')
    apartment_id = Column(INTEGER(11), server_default=text("'0'"), comment='门店id')
    import_status = Column(TINYINT(1), server_default=text("'0'"), comment='老合同是否参与：1否，2是')
    service_status = Column(TINYINT(1), comment='应收金额是否包含服务费(1 不含 2 包含)')
    all_status = Column(TINYINT(1), comment='是否通提(1 否 2是)')
    check_status = Column(TINYINT(1), comment='判断条件(1 无  2是)')
    pipelining_proportion = Column(DECIMAL(10, 2), server_default=text("'0.00'"), comment='流水计提比例')
    software_fee_proportion = Column(DECIMAL(10, 2), server_default=text("'0.00'"), comment='软件费比例')
    valid_type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='生效类型（1:永久2选定时间段）')
    commision_valid_begin_time = Column(INTEGER(10), server_default=text("'0'"), comment='规则有效开始时间')
    commision_valid_end_time = Column(INTEGER(10), server_default=text("'0'"), comment='规则有效结束时间')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), server_default=text("'0'"), comment='修改时间')
    delete_status = Column(TINYINT(1), server_default=text("'0'"), comment='删除状态(1:未删除,2:已删除)')
    delete_time = Column(INTEGER(11), server_default=text("'0'"), comment='删除时间')


class UponcommisionSurrenderPipeliningRuleCondition(Base):
    __tablename__ = 'uponcommision_surrender_pipelining_rule_condition'

    uponcommision_surrender_pipelining_rule_condition_id = Column(String(32), primary_key=True, comment='主键ID')
    uponcommision_surrender_pipelining_rule_id = Column(String(32), comment='有朋提佣-退租退订的流水计提规则主键ID')
    cal_type = Column(TINYINT(1), server_default=text("'0'"), comment='计算基数(1 流水计提 2 软件费/人才费)')
    index_type = Column(TINYINT(1), comment='指标(1 入住率 2 招租率 3 间夜出租率)')
    index_begin = Column(DECIMAL(10, 2), server_default=text("'0.00'"), comment='指标区间开始')
    index_end = Column(DECIMAL(10, 2), server_default=text("'0.00'"), comment='指标区间结束')
    cal_proportion = Column(DECIMAL(10, 2), server_default=text("'0.00'"), comment='计算比例')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), server_default=text("'0'"), comment='修改时间')
    delete_status = Column(TINYINT(1), server_default=text("'0'"), comment='删除状态(1:未删除,2:已删除)')
    delete_time = Column(INTEGER(11), server_default=text("'0'"), comment='删除时间')


class UponcommisionTransferRecord(Base):
    __tablename__ = 'uponcommision_transfer_record'

    uponcommision_transfer_record_id = Column(VARCHAR(32), primary_key=True, comment='有朋结佣转账记录表主键id')
    transfer_amount = Column(DECIMAL(12, 2), nullable=False, server_default=text("'0.00'"), comment='转账总金额')
    receive_amount = Column(DECIMAL(12, 2), server_default=text("'0.00'"), comment='到账金额')
    payment_account_id = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='付款账户ID')
    receivables_account_id = Column(VARCHAR(32), nullable=False, server_default=text("''"), comment='收款账户ID')
    transfer_status = Column(TINYINT(1), server_default=text("'0'"), comment='状态：0新建记录，1成功，2失败，3异常（如金额不对）')
    transfer_remark = Column(VARCHAR(255), server_default=text("''"), comment='备注（若转账失败的原因备注）')
    payment_time = Column(INTEGER(10), server_default=text("'0'"), comment='到账时间')
    employee_id = Column(VARCHAR(32), server_default=text("''"), comment='操作人')
    create_time = Column(INTEGER(10), server_default=text("'0'"))
    update_time = Column(INTEGER(10), server_default=text("'0'"))
    delete_status = Column(TINYINT(1), server_default=text("'1'"), comment='1正常，2删除')
    delete_time = Column(INTEGER(10), server_default=text("'0'"))
    type = Column(INTEGER(1), server_default=text("'0'"), comment='提现类型：1销售佣金，2流水计提，3软件费，4销售佣金（续约），5流水计提（退租退订），6软件费（退租退订）')
    apartment_id = Column(INTEGER(11), server_default=text("'0'"), comment='门店id')


class UserGroup(Base):
    __tablename__ = 'user_group'

    user_group_id = Column(INTEGER(11), primary_key=True, comment='用户组id')
    user_group_name = Column(VARCHAR(32), nullable=False, comment='用户组名称')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')


class UserGroupTenantRelationship(Base):
    __tablename__ = 'user_group_tenant_relationship'

    user_group_tenant_relationship_id = Column(INTEGER(10), primary_key=True)
    user_group_id = Column(INTEGER(11), nullable=False, comment='用户组id')
    tenant_id = Column(INTEGER(11), nullable=False, comment='租客id')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')


class WeatherMoji(Base):
    __tablename__ = 'weather_moji'

    weather_id = Column(String(32), primary_key=True, server_default=text("''"))
    apartment_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='门店ID')
    lat = Column(DECIMAL(16, 12), nullable=False, index=True, server_default=text("'0.000000000000'"), comment='超精细纬度')
    lon = Column(DECIMAL(16, 12), nullable=False, index=True, server_default=text("'0.000000000000'"), comment='超精细经度')
    conditionDay = Column(String(50), server_default=text("''"), comment='白天天气')
    conditionIdDay = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='白天天气图标')
    conditionNight = Column(String(50), nullable=False, server_default=text("''"), comment='夜间天气')
    conditionIdNight = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='夜间天气图标')
    predictDate = Column(CHAR(10), nullable=False, server_default=text("''"), comment='预报日期(年-月-日)')
    predictDateStamp = Column(INTEGER(10), nullable=False, index=True, server_default=text("'0'"), comment='预报日期时间戳')
    tempDay = Column(String(10), nullable=False, server_default=text("'0'"), comment='白天温度')
    tempNight = Column(String(10), nullable=False, server_default=text("'0'"), comment='夜间温度')
    windDirDay = Column(String(50), server_default=text("''"), comment='白天风向')
    windDirNight = Column(String(50), server_default=text("''"), comment='夜间风向')
    windLevelDay = Column(String(10), nullable=False, server_default=text("''"), comment='白天风级')
    windLevelNight = Column(String(10), nullable=False, server_default=text("''"), comment='夜间风级')
    city_counname = Column(String(50), server_default=text("''"), comment='国家')
    city_pname = Column(String(50), server_default=text("''"), comment='省')
    city_name = Column(String(50), server_default=text("''"), comment='市/区')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    delete_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='1 正常，2 删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))


class WithEmployee(Base):
    __tablename__ = 'with_employee'
    __table_args__ = (
        Index('table_name', 'table_name', 'table_id'),
    )

    with_employee_id = Column(String(32), primary_key=True)
    organization_id = Column(INTEGER(11), nullable=False, server_default=text("'1'"), comment='组织ID')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    table_name = Column(String(100), nullable=False, server_default=text("''"), comment='产生带户的表名称')
    table_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='产生带户的表ID')
    employee_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='员工ID')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    effective_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='1:有效,2:无效,3:失效')


class WorkOrderAppraise(Base):
    __tablename__ = 'work_order_appraises'
    __table_args__ = (
        Index('work_order_details_id', 'work_order_details_id', 'work_order_appraises_id'),
    )

    work_order_appraises_id = Column(VARCHAR(32), primary_key=True, comment='主键(UUID)')
    work_order_details_id = Column(INTEGER(11), comment='客户工单id')
    resolve_result = Column(TINYINT(4), comment='处理结果(1 好评，2 中评，3 差评)')
    resolve_star = Column(TINYINT(4), comment='服务态度(1-5)')
    service_description = Column(VARCHAR(1024), comment='服务描述')
    create_time = Column(INTEGER(10), comment='创建时间')
    update_time = Column(INTEGER(10), comment='更新时间')
    delete_status = Column(TINYINT(4), index=True, comment='是否删除(0 正常，1 删除)')
    delete_time = Column(INTEGER(10), comment='删除时间')


class WorkOrderAppraisesPicture(Base):
    __tablename__ = 'work_order_appraises_picture'

    work_order_appraises_picture_id = Column(VARCHAR(32), primary_key=True, comment='主键(UUID)')
    work_order_appraises_id = Column(VARCHAR(32), comment='工单评价ID')
    picture_url = Column(VARCHAR(255), comment='图片地址')
    create_time = Column(INTEGER(10), comment='创建时间')
    update_time = Column(INTEGER(10), comment='更新时间')
    delete_status = Column(TINYINT(4), comment='是否删除(0 正常，1 删除)')
    delete_time = Column(INTEGER(10), comment='删除时间')


class WorkOrderDetail(Base):
    __tablename__ = 'work_order_details'
    __table_args__ = (
        Index('time', 'create_time', 'update_time'),
        Index('phone', 'phone', 'source_channel', 'priority_level', 'room_number'),
        Index('fx_work_detail_id_apartment_id_accept_id', 'apartment_id', 'work_detail_id', 'organization_id', 'accept_id')
    )

    work_detail_id = Column(INTEGER(11), primary_key=True, comment='ID')
    source_table = Column(VARCHAR(150), nullable=False, server_default=text("''"), comment='详情数据来源表')
    source_channel = Column(VARCHAR(150), nullable=False, server_default=text("''"), comment='详情数据来源渠道')
    priority_level = Column(INTEGER(11), nullable=False, server_default=text("'1'"), comment='优先级 1普通,2紧急,3很紧急')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    object_of_complaint = Column(VARCHAR(2500), nullable=False, server_default=text("''"), comment='投诉对象')
    applicant = Column(VARCHAR(150), nullable=False, index=True, server_default=text("''"), comment='申请人')
    phone = Column(VARCHAR(150), nullable=False, server_default=text("''"), comment='申请人电话')
    room_number = Column(VARCHAR(150), nullable=False, server_default=text("''"), comment='申请人房间')
    title = Column(VARCHAR(150), nullable=False, server_default=text("''"), comment='主题/标题')
    describes = Column(Text, comment='描述')
    creator = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建人ID')
    status = Column(INTEGER(11), nullable=False, index=True, server_default=text("'1'"), comment='状态 1待处理,2处理中,3无需处理,4已处理')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, index=True, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    accept_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='受理人')
    appraises_status = Column(TINYINT(4))
    audit_status = Column(TINYINT(4))
    organization_id = Column(VARCHAR(32), comment='组织机构')
    respond_time = Column(INTEGER(11), comment='响应时间')


class WorkOrderDetailsPicture(Base):
    __tablename__ = 'work_order_details_picture'

    work_detail_picture_id = Column(INTEGER(11), primary_key=True, comment='ID')
    work_detail_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='工单详情内容ID')
    picture_url = Column(String(150), nullable=False, server_default=text("''"), comment='地址')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class WorkOrderFlow(Base):
    __tablename__ = 'work_order_flow'

    work_order_flow_id = Column(INTEGER(11), primary_key=True, comment='ID')
    work_detail_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='工单详情内容ID')
    flow_rule_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='自动推送规则ID')
    creator_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建人ID')
    flow_table = Column(String(150), nullable=False, server_default=text("''"), comment='推送人/部门的表名')
    parent_flow_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='父级流程id')
    dispose_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='处理人id')
    issue_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='下发时间')
    flow_time_limit = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='时间限制')
    dispose_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='处理时间')
    flow_status = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='流程状态 0待处理,1处理中,2拒绝处理,3处理完成,4无需处理')
    flow_send_duplicate = Column(String(150), nullable=False, server_default=text("''"), comment='抄送人 1,2,22')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class WorkOrderFollowUp(Base):
    __tablename__ = 'work_order_follow_up'
    __table_args__ = (
        Index('fx_work_order_work_detail_create_time', 'work_order_follow_up_id', 'work_detail_id', 'create_time'),
    )

    work_order_follow_up_id = Column(INTEGER(11), primary_key=True, comment='ID')
    work_detail_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='工单详情内容ID')
    follow_up_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='跟进人ID')
    content = Column(Text, nullable=False, comment='跟进内容')
    status = Column(INTEGER(11), nullable=False, server_default=text("'1'"), comment='跟进状态 1待处理,2处理中,3无需处理,4已处理')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    attribute = Column(String(255), comment='属性')
    old_content = Column(Text, comment='旧值')
    new_content = Column(Text, comment='新值')


class WorkflowOrder(Base):
    __tablename__ = 'workflow_order'

    workflow_order_id = Column(INTEGER(11), primary_key=True)
    bill_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='账单ID')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    room_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='房间ID')
    tenant_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='租客ID')
    preordain_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='预定ID')
    table_name = Column(String(60), nullable=False, server_default=text("''"), comment='来源表名称')
    table_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='来源表ID')
    master_table_name = Column(String(60), nullable=False, server_default=text("''"), comment='表名称（预定合同）')
    master_table_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='表ID（预定合同）')
    order_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='订单金额')
    discount_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='优惠金额')
    pay_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='订单应收金额')
    received_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='实际到账金额')
    source = Column(String(255), nullable=False, server_default=text("''"), comment='来源')
    service_code = Column(String(255), nullable=False, server_default=text("''"), comment='类型,同场景配置')
    keywords = Column(String(255), nullable=False, server_default=text("''"), comment='搜索关键词')
    audit_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='审核时间')
    is_audit = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='审核状态，0：未审核，1已审核，2：已拒绝，3：已失效')
    pay_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='支付状态 0未支付，1支付中，2取消支付，3支付失败，4支付成功,5支付金额错误')
    opinion = Column(String(255), nullable=False, server_default=text("''"), comment='处理意见')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class Worksheet(Base):
    __tablename__ = 'worksheet'

    worksheet_id = Column(INTEGER(11), primary_key=True)
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    bill_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='账单ID')
    applicant_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='申请人')
    submit_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='提交人')
    operator_type = Column(String(50), nullable=False, server_default=text("''"), comment='操作类型')
    status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='状态(0:未处理，1：已处理，2：已拒绝)')
    handle_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='处理时间')
    data = Column(Text, nullable=False, comment='数据')
    explain = Column(String(255), nullable=False, server_default=text("''"), comment='说明')
    opinion = Column(String(255), nullable=False, server_default=text("''"), comment='处理意见')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')


class WriteOff(Base):
    __tablename__ = 'write_off'

    write_off_id = Column(INTEGER(11), primary_key=True)
    company_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='公司ID')
    bill_id = Column(String(64), nullable=False, index=True, server_default=text("'0'"), comment='账单ID')
    write_off_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='核销金额')
    bank_account_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='核销账户')
    bank_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='银行存款')
    cash_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='现金')
    finance_money = Column(DECIMAL(10, 2), nullable=False, server_default=text("'0.00'"), comment='账务费用')
    post_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='入账时间')
    is_batch = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否批量')
    document_number = Column(String(255), nullable=False, comment='核销单据号')
    finance_sequence_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='财务流水ID')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class WxappOrder(Base):
    __tablename__ = 'wxapp_order'

    wxapp_order_id = Column(INTEGER(11), primary_key=True)
    order_no = Column(String(200), nullable=False, index=True, server_default=text("''"), comment='对外提供的唯⼀一订单号')
    transaction_id = Column(String(50), nullable=False, server_default=text("''"), comment='微信订单号')
    out_trade_no = Column(String(200), nullable=False, server_default=text("''"), comment='唯⼀一订单号')
    prepay_id = Column(String(200), nullable=False, server_default=text("''"), comment='微信预⽀支付ID')
    appid = Column(String(20), nullable=False, server_default=text("''"), comment='wx_appid')
    mch_id = Column(String(15), nullable=False, server_default=text("''"), comment='商户号')
    openid = Column(String(100), nullable=False, server_default=text("''"), comment='微信OPEN_ID')
    unionid = Column(String(100), nullable=False, server_default=text("''"), comment='微信unionid')
    spbill_ip = Column(String(20), nullable=False, server_default=text("''"), comment='服务IP')
    order_name = Column(String(128), nullable=False, server_default=text("''"), comment='订单名称')
    total_money = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='订单总⾦金金额')
    coupon_money = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='优惠⾦金金额')
    pay_money = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='⽤用户需要⽀支付⾦金金额')
    received_money = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='实收⾦金金额')
    pay_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='⽀支付时间')
    pay_status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='⽀支付状态; 0未⽀支付，1⽀支付中，2取消⽀支付，3⽀支付失败，4⽀支付成功，5⽀支付⾦金金额错误')
    expired_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='过期时间')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


t_wxapp_order_notify = Table(
    'wxapp_order_notify', metadata,
    Column('wxapp_order_id', INTEGER(10), nullable=False, index=True, server_default=text("'0'"), comment='订单ID'),
    Column('request_content', Text, nullable=False, comment='发起回调内容'),
    Column('request_return', Text, nullable=False, comment='发起回调后返回内容'),
    Column('notify_info', Text, nullable=False, comment='微信回调内容'),
    Column('notify_url', String(255), nullable=False, server_default=text("''"), comment='第三⽅方回调地址'),
    Column('third_notify_data', Text, nullable=False, comment='第三方回调内容'),
    Column('third_notify_result', Text, nullable=False, comment='第三方回调结果'),
    Column('is_delete', TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除'),
    Column('create_time', INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间'),
    Column('update_time', INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间'),
    Column('delete_time', INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
)


t_wxapp_subscribe_user = Table(
    'wxapp_subscribe_user', metadata,
    Column('openid', String(100), nullable=False, unique=True, server_default=text("''"), comment='微信OPEN_ID'),
    Column('nick_name', VARCHAR(200), nullable=False, index=True, server_default=text("''"), comment='微信昵称'),
    Column('subscribe', TINYINT(1), nullable=False, server_default=text("'0'"), comment='1 关注 0 取消关注'),
    Column('gender', TINYINT(1), nullable=False, server_default=text("'1'"), comment='性别 1: 男 2: ⼥女女'),
    Column('language', String(30), nullable=False, server_default=text("''"), comment='语⾔言'),
    Column('city', String(50), nullable=False, server_default=text("''"), comment='所在城市'),
    Column('province', String(50), nullable=False, server_default=text("''"), comment='所在省份'),
    Column('country', String(50), nullable=False, server_default=text("''"), comment='所在国家'),
    Column('headimgurl', String(255), nullable=False, server_default=text("''"), comment='头像'),
    Column('unionid', String(50), nullable=False, server_default=text("''"), comment='unionid'),
    Column('remark', String(255), nullable=False, server_default=text("''"), comment='备注'),
    Column('groupid', TINYINT(1), nullable=False, server_default=text("'0'"), comment='groupid'),
    Column('tagid_list', String(255), nullable=False, server_default=text("''"), comment='tagid_list'),
    Column('subscribe_scene', String(255), nullable=False, server_default=text("''"), comment='subscribe_scene'),
    Column('qr_scene', String(255), nullable=False, server_default=text("''"), comment='qr_scene'),
    Column('qr_scene_str', String(255), nullable=False, server_default=text("''"), comment='qr_scene_str'),
    Column('subscribe_time', INTEGER(10), nullable=False, server_default=text("'0'"), comment='关注时间'),
    Column('create_time', INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间'),
    Column('update_time', INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间'),
    Column('is_delete', TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除'),
    Column('delete_time', INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
)


t_wxapp_user = Table(
    'wxapp_user', metadata,
    Column('openid', String(100), nullable=False, unique=True, server_default=text("''"), comment='微信OPEN_ID'),
    Column('nick_name', String(200), nullable=False, index=True, server_default=text("''"), comment='微信昵称'),
    Column('gender', TINYINT(1), nullable=False, server_default=text("'1'"), comment='性别 1: 男 2: ⼥女女'),
    Column('language', String(30), nullable=False, server_default=text("''"), comment='语⾔言'),
    Column('city', String(50), nullable=False, server_default=text("''"), comment='所在城市'),
    Column('province', String(50), nullable=False, server_default=text("''"), comment='所在省份'),
    Column('country', String(50), nullable=False, server_default=text("''"), comment='所在国家'),
    Column('avatarurl', String(255), nullable=False, server_default=text("''"), comment='头像'),
    Column('unionid', String(50), nullable=False, server_default=text("''"), comment='unionid'),
    Column('watermark', String(255), nullable=False, server_default=text("''"), comment='watermark'),
    Column('create_time', INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间'),
    Column('update_time', INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间'),
    Column('is_delete', TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除'),
    Column('delete_time', INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
)


t_wxapp_user_tag = Table(
    'wxapp_user_tag', metadata,
    Column('tag_id', INTEGER(11), nullable=False, unique=True, server_default=text("'0'"), comment='标签ID'),
    Column('name', String(255), nullable=False, server_default=text("''"), comment='微信标签'),
    Column('create_time', INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间'),
    Column('update_time', INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间'),
    Column('is_delete', TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除'),
    Column('delete_time', INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
)


t_wxapp_user_tag_relation = Table(
    'wxapp_user_tag_relation', metadata,
    Column('openid', String(100), nullable=False, index=True, server_default=text("''"), comment='微信OPEN_ID'),
    Column('tag_id', INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='标签ID'),
    Column('create_time', INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间'),
    Column('update_time', INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间'),
    Column('is_delete', TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除'),
    Column('delete_time', INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
)


class YeeuuLock(Base):
    __tablename__ = 'yeeuu_lock'

    yeeuu_lock_id = Column(INTEGER(11), primary_key=True, comment='主键ID')
    apartment_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='门店ID')
    room_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='room_id')
    house_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='house_id')
    code = Column(String(30), nullable=False, index=True, server_default=text("''"), comment='CODE(house-house_id-room_id)')
    name = Column(String(30), nullable=False, server_default=text("''"), comment='room_number / house_number')
    yy_host = Column(String(30), nullable=False, server_default=text("''"), comment='云柚host')
    yy_device = Column(String(30), nullable=False, index=True, server_default=text("''"), comment='云柚SN-设备号')
    yy_electric = Column(TINYINT(3), nullable=False, server_default=text("'0'"), comment='电量')
    yy_is_off = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否离线')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='更新时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间')
    call_back_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='云柚回调时间')
    call_back_data = Column(MEDIUMTEXT, nullable=False, comment='云柚回调参数')


class YeeuuLockApiCallback(Base):
    __tablename__ = 'yeeuu_lock_api_callback'

    yeeuu_lock_api_callback_id = Column(INTEGER(11), primary_key=True)
    yeeuu_lock_api_type = Column(TINYINT(2), nullable=False, server_default=text("'0'"), comment='API请求类型 1-回写SN 2-回写电量 3-回写在线状态 4-回写开门记录')
    yeeuu_lock_sn = Column(String(30), nullable=False, index=True, server_default=text("''"), comment='锁SN')
    yeeuu_lock_api_data = Column(MEDIUMTEXT, nullable=False, comment='接口数据')
    yeeuu_lock_api_ip = Column(String(16), nullable=False, server_default=text("''"), comment='请求IP')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='请求时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='更新时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class YeeuuLockOpenLog(Base):
    __tablename__ = 'yeeuu_lock_open_log'

    yeeuu_lock_open_log_id = Column(INTEGER(11), primary_key=True)
    yeeuu_lock_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='门锁ID')
    yeeuu_lock_open_type = Column(TINYINT(2), nullable=False, server_default=text("'3'"), comment='开门方式: 0-机械钥匙开门 1-刷卡开门 3-远程开门 6-密码开门 7-动态密码开门')
    yeeuu_lock_password_index = Column(TINYINT(2), nullable=False, server_default=text("'0'"), comment='密码编号')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='开门时间')
    update_time = Column(INTEGER(10), nullable=False, comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间')


class YeeuuLockPassword(Base):
    __tablename__ = 'yeeuu_lock_password'

    yeeuu_password_id = Column(INTEGER(11), primary_key=True, comment='主键')
    yeeuu_lock_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='云柚锁ID')
    room_id = Column(INTEGER(10), nullable=False, index=True, server_default=text("'0'"), comment='房间ID')
    house_id = Column(INTEGER(10), nullable=False, index=True, server_default=text("'0'"), comment='大门ID')
    code = Column(String(64), nullable=False, index=True, server_default=text("' '"), comment='云柚code')
    password_number = Column(TINYINT(2), nullable=False, server_default=text("'0'"), comment='密码编号1-50')
    password_type = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='密码类型-1:普通密码，2:次数密码')
    password = Column(String(10), nullable=False, server_default=text("' '"), comment='云柚密码')
    name = Column(String(100), nullable=False, server_default=text("''"), comment='姓名(租客/管理员)')
    phone = Column(String(11), nullable=False, server_default=text("''"), comment='电话（ 租客电话 / 管理员电话）')
    contract_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='合同ID')
    auth_type = Column(Enum('tenant', 'employee'), nullable=False, server_default=text("'tenant'"), comment='授权类型（员工 / 租客）')
    auth_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='授权ID ( 租客ID / 管理员ID )')
    begin_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='密码开始时间')
    end_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='密码结束时间')
    operator_employee_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='操作人ID')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='更新时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间')
    is_lock = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否锁定')
    lock_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='锁定/解锁时间')


class YeeuuPassword(Base):
    __tablename__ = 'yeeuu_password'

    yeeuu_password_id = Column(INTEGER(11), primary_key=True, comment='智能门锁ID')
    table_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='房间ID')
    table_name = Column(String(64), nullable=False, server_default=text("' '"), comment='表名')
    code = Column(String(64), nullable=False, server_default=text("' '"), comment='云柚code')
    password = Column(String(64), nullable=False, server_default=text("' '"), comment='云柚密码')
    phone = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='授权电话')
    begin_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='开始时间')
    end_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='结束时间')
    operator_employee_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='操作人ID')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='更新时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='删除时间')


class YsMemberCompany(Base):
    __tablename__ = 'ys_member_company'

    ys_member_company_id = Column(INTEGER(11), primary_key=True)
    real_name = Column(String(32), nullable=False, server_default=text("''"), comment='真实姓名')
    identity_type = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='证件类型')
    wx_merchant_id = Column(String(32), nullable=False, server_default=text("''"), comment='微信商户号')
    wx_app_id = Column(String(32), nullable=False, server_default=text("''"), comment='微信APP_ID')
    wx_app_secret = Column(String(32), nullable=False, server_default=text("''"), comment='微信AppSecret')
    wx_payment_key = Column(String(32), nullable=False, server_default=text("''"), comment='微信Paymentkey支付秘钥')
    alipay_app_id = Column(String(32), nullable=False, server_default=text("''"), comment='支付宝APP_ID')
    alipay_merchant_private_key = Column(MEDIUMTEXT, nullable=False, comment='支付宝商户私钥')
    alipay_public_key = Column(MEDIUMTEXT, nullable=False, comment='支付宝公钥')
    alipay_notify_public_key = Column(MEDIUMTEXT, nullable=False, comment='支付宝异步通知公钥')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class YueePwd(Base):
    __tablename__ = 'yuee_pwd'

    id = Column(INTEGER(11), primary_key=True, comment='ID')
    sn = Column(String(64), server_default=text("'0'"), comment='云柚门锁sn')
    password = Column(INTEGER(10), server_default=text("'0'"), comment='密码')
    type = Column(TINYINT(1), server_default=text("'0'"), comment='类型')
    startime = Column(String(32), server_default=text("'0'"), comment='开始时间')
    endtime = Column(String(32), server_default=text("'0'"), comment='结束时间')
    index = Column(INTEGER(11), server_default=text("'0'"), comment='门锁ID')


class YueeuuAddpasswordException(Base):
    __tablename__ = 'yueeuu_addpassword_exception'

    yueeuu_addpassword_exception_id = Column(INTEGER(11), primary_key=True, comment='云柚添加门锁密码异常主键ID')
    apartment_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='门店ID')
    room_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment=' 房间ID')
    password = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment=' 密码')
    password_uuid = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='密码编号')
    lock_sn = Column(String(64), nullable=False, server_default=text("''"), comment=' 锁sn')
    result = Column(String(256), nullable=False, server_default=text("''"), comment=' 云柚返回结果')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')


class Zone(Base):
    __tablename__ = 'zone'

    zone_id = Column(INTEGER(11), primary_key=True)
    city_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='城市ID')
    area_id = Column(INTEGER(11), nullable=False, index=True, server_default=text("'0'"), comment='区域ID')
    letter = Column(String(5), nullable=False, server_default=text("''"), comment='首写字母')
    zone_name = Column(String(50), nullable=False, server_default=text("''"), comment='商圈名称')
    operator_employee_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='操作人')
    create_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='新增时间')
    update_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='修改时间')
    is_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否删除')
    delete_time = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='删除时间')
    longitude = Column(DECIMAL(14, 5), nullable=False, comment='经度')
    latitude = Column(DECIMAL(14, 5), nullable=False, comment='纬度')
